我有这个下拉菜单,当它悬停时,一些内容在另一个 div 后面。它看起来像这样:
菜单的 css 是这样的:
.nav-m {
height: 50px;
width: 60px;
display: block;
position: absolute;
z-index: 9999;
overflow-y: hidden;
text-align: center;
position: absolute;
}
.nav-m:hover {
width: 140px;
height: 210px;
}
.nav-m a {
display: none;
text-indent: -9999px;
position: relative;
height: 20px;
padding: 13px 0;
color: #fff !important;
}
nav a:first-child:hover {
text-indent: -9999px;
}
.nav-m:hover>a {
display: block;
}
.nav-m:hover>a:first-child:after {
color: #6daeaf;
background: #505664;
}
.nav-m a:first-child {
display: block;
text-align: center;
margin-bottom: 16px;
cursor: default;
}
.nav-m a:after {
position: absolute;
top: 0;
padding: 12px 0;
width: 60px;
color: #fff;
font-family: 'icons';
font-size: 24px;
display: block;
text-indent: 0;
background: #6daeaf;
}
nav a:hover {
text-indent: 0px;
text-align: left;
margin-left: 70px;
}
.nav-m a:hover:after {
color: #999;
background: #fff;
text-align: center;
margin-left: -70px;
}
.nav-m a:first-child:before {
position: absolute;
text-indent: 0;
top: 55px;
left: 23px;
content: "";
width: 0;
height: 0;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
border-bottom: 7px solid #6daeaf;
}
.nav-m a:first-child:hover:before {
margin-left: -70px;
}
.nav-m a:first-child:after {
left: 0;
content: "m";
background: #656d7e;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
.nav-m a:nth-child(2):after {
content: "p";
-webkit-border-top-left-radius: 5px;
-webkit-border-top-right-radius: 5px;
-moz-border-radius-topleft: 5px;
-moz-border-radius-topright: 5px;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
}
.nav-m a:nth-child(3):after {
content: "s";
}
.nav-m a:last-child:after {
content: "e";
-webkit-border-bottom-left-radius: 5px;
-webkit-border-bottom-right-radius: 5px;
-moz-border-radius-bottomleft: 5px;
-moz-border-radius-bottomright: 5px;
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
}
菜单 div 下方是 .container、.row 和 class='span12' 的 div(我使用的是引导程序)
HTML 如下所示:
<div id="topbg">
<div class="span9">span9 content here</div>
<div class="span3 avatar-holder" >
<nav class="nav-m" onmouseover="">
<a href="#" title="Menu">Menu</a>
<a href="#" title="Account">Account</a>
<a href="#" title="Settings">Settings</a>
<a href="#" title="Email">Email</a>
<a href="#" title="Email">Email</a>
<a href="#" title="Email">Email</a>
<a href="#" title="Email">Email</a>
<a href="#" title="Email">Email</a>
<a href="#" title="Email">Email</a>
<a href="#" title="Email">Email</a>
</nav>
</div>
</div>
</div><!--end row-->
</div><!--end topbg-->
<div class='container' style='margin-top:20px;'>
<div class='row'>
<div class='span12' style='margin:0;'>
span 12 content
</div><!--end span12-->
</div><!--end row-->
因此,我尝试在以下 div 上将 z-index 设置为 -1:.row、.container、.span12,但没有成功。我还尝试将溢出设置为在每个可能的 div 上可见。我在这里找不到问题。
谁能帮我吗?