所以这里是测试站点:http ://rjewkes.com/index.php
如果您滚动菜单项,您会看到“li span”元素位于“li”元素前面。但我想反过来。我对它们进行了适当的 z 索引,但由于某种原因它不起作用。
ul#topnav {
margin: 0 0 0 0;
padding: 0;
float: left;
width: 1000px;
height:28px;
list-style: none;
position: relative;
background:url(images/navbar.jpg) no-repeat;
background-position:top left;
z-index:1000;
}
ul#topnav li {
float: left;
margin-top: 0;
padding: 9px 0px 5px 0px;
z-index:1000;
}
ul#topnav li a {
float:left;
padding: 0 25px;
font-size:11px !important;
font-weight:bold;
display: block;
border:#transparent solid 1px;
color: #003654;
text-decoration: none;
z-index:1000;
}
ul#topnav li:hover {
background-color:#FFF;
position:static;
margin: -1px -1px 0 -1px !important;
padding-bottom:15px !important;
border-right: 1px solid #ccc;
border-top:#CCC solid 1px;
border-left:#CCC solid 1px;
z-index:1000;
}
ul#topnav li span {
float: left;
padding: 15px 0;
position: absolute;
left: 0;
top:24px;
display: none;
width: 998px;
background-image:url(images/opacity.png);
color: #ccc;
z-index:1000;
}
ul#topnav li:hover span {
display: block;
height:140px;
border: 1px solid #ccc;
margin-top:7px;
margin-left:-1px;
z-index:997;
-moz-box-shadow: 0px 8px 6px -6px rgba(0,0,0,0.1);
-webkit-box-shadow: 0px 8px 6px -6px rgba(0,0,0,0.1);
box-shadow: 0px 8px 6px -6px rgba(0,0,0,0.1);
/* For IE 8 */
-ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=180, Color='#000000')";
/* For IE 5.5 - 7 */
filter: progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=180, Color='#000000');
}
ul#topnav li span a {
background: transparent;
font-size:11px !important;
text-align:left;
border-left: 1px solid #ccc;
margin:5px 0 10px -1px;
padding:0 10px 0 20px;
width:100px;
height:130px;
display: inline;
z-index:997;
}
ul#topnav li span a:hover {
text-align:left;
color:#449ec7;
text-decoration: none;
z-index:997;
}
ul#topnav li span img {
position: relative;
float:right;
margin:10px 20px 0 0;
padding:0 0 0 0;
z-index:997;
}
我将不胜感激任何有助于解决此问题的反馈。