嘿伙计们,我有以下几点:
<ul class='main_nav'>
<li class='first' style='padding-top:0;'><a href='#' onclick='return false;'><span class='shaper'>Tools</span></a>
<ul>
<li class='second'><a href='emailfunction.php'>Email Tool</a></li>
<li class='second'><a href='insurancetool.php'>Insurance Tool</a></li>
<li class='second'><a href='monthlyreport.php'>Monthly Report Tool</a></li>
<li class='second'><a href='statuschanger.php'>Status Change Tool</a></li>
<li class='second'><a href='addtool.php'>Add Tool</a></li>
<li class='second'><a href='revisetool.php'>Revise Tool</a></li>
<li class='second'><a href='csvuploaderform.php'>Upload an Employee List (.csv file)</a></li>
<li class='second'><a href='csvmanualuploaderform.php'>Upload a Single Employee</a></li>
<li class='second'><a href='insuranceverificationviewer.php'>View Employee Car Insurance Information</a></li>
</ul>
</li>
</ul>
所以这是我的导航,这里是样式:
.main_nav {
display: block;
float: left;
width: 118px;
height: 60px;
background: #009;
margin: 0 .5% 0 0;
padding:0;
color:black;
}
.main_nav:hover{
background: lightgray;
border-top:1px solid #009;
border-right:1px solid #009;
border-left:1px solid #009;
color:#009;
}
.main_nav .first {
text-align: center;
width: 100%;
color:white;
z-index:9999;
}
.main_nav li a {
color:white;
height:60px;
display: block;
z-index:9999;
}
.main_nav a:hover {
color:black;
}
.main_nav li {
list-style:none;
z-index:9999;
}
.main_nav li:hover {
}
.main_nav ul {
display:none;
list-style:none;
position:relative;
float: left;
z-index:9999;
}
.main_nav li:hover > ul {
display: block;
padding:0;
margin:0;
position:absolute;
background: lightgray;
}
.main_nav li ul li {
border-left:1px solid #009;
border-right:1px solid #009;
border-bottom:1px solid #009;
z-index:9999;
}
所以这很好用,除了在 IE 中,我有这个问题是我有一个绝对的 div,它在它的底部添加了一条线。事情是在 IE 中,当您将鼠标悬停在上方时,该行会放在显示的顶部导航之前。在谷歌,火狐这一切都很棒。
这里是酒吧:
<div class="top-backgroundwrap">
</div><!-- top-backgroundwrap -->
.top-backgroundwrap {
width: 100%;
height: 20px;
background: lightgray;
margin-top: -24px;
}
我尝试过使用 z-index,但没有成功。我注意到 IE 将其视为最上一个位置:绝对;并在减少索引后将其显示在前面。如果你能帮我一把,我将不胜感激。需要帮助请叫我。
大卫