我正在使用 Bootstrap 2.3.1 http://twitter.github.io/bootstrap/index.html
所以我使用他们的“下拉菜单”类来创建一些简单的快速使用下拉菜单,但由于某种原因在IE7上它们出现在我网站上的文本和其他元素的后面。
测试链接: http: //leongaban.com/_projects/defakto/CDS/
我在我的 CSS 中添加了 z-index,但似乎仍然没有做任何事情,请帮忙!
.header .header-nav ul#nav-account ul.dropdown-menu,
.header .header-nav ul#nav-library ul.dropdown-menu {
z-index: 10000;
}
IE9、Chrome、FF 等现代不头痛的浏览器:
IE7 >:(
HTML
<div class="header-nav">
<ul id="nav-account" role="navigation" class="pull-right">
<!-- Language Dropdown Button -->
<li id="language-btn">
<a href="#" id="drop1" class="dropdown-toggle" data-toggle="dropdown">English</a>
<img src="img/header-small-down-arrow.png" alt="grey triangle"/><!-- <span class="grey_triangle"></span>-->
<!-- Language Dropdown Menu-->
<ul class="dropdown-menu" role="menu" aria-labelledby="drop1">
<li role="presentation"><a role="menuitem" tabindex="-1" href="#">English</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="#">Spanish</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="#">German</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="#">Japanese</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="#">Chinese</a></li>
</ul>
</li>
<!-- User Dropdown Button -->
<li id="account-btn">
<a href="#" id="drop2" class="dropdown-toggle" data-toggle="dropdown">Logout</a>
<img src="img/header-small-down-arrow.png" alt="grey triangle"/>
<!-- <span class="grey_triangle"></span> -->
<!-- User Dropdown Menu-->
<ul class="dropdown-menu" role="menu" aria-labelledby="drop2">
<li role="presentation"><a role="menuitem" tabindex="-1" href="http://google.com">Logout</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="#anotherAction">Account</a></li>
</ul>
</li>
</ul>