ie6 上的 z-index 问题
嘿,
我在 ie6 的一个 bug 上运行了几个小时,这不是我锁定的唯一一个,它仍然只是为了解决这个问题,我终于会安静了。
我构建了一个垂直菜单,问题是尽管有 z 索引,第二级菜单并不与第一级菜单重叠。在FF下是无可挑剔的,在ie6下还算可以。
这是我的代码,如果你能帮助你大大减轻我的负担:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title></title>
</head>
<style type="text/css">
<!--
* {
margin: 0;
padding: 0;
}
div#menu {
width: 100px;
}
div#menu ul {
padding: 0;
width: 100px;
border: 1px solid green;
margin: 0px;
background: yellow url();
position: absolute;
z-index: 1;
}
div#menu ul li {
position: relative;
list-style: none;
}
div#menu ul ul {
position: absolute;
top: 0px;
left: 10px;
display: block;
background: red url();
z-index: 999;
border: 1px solid black;
}
div#menu li a {
text-decoration: none;
}
//-->
</style>
<body>
<div id="menu">
<ul>
<li><a href="">menu 1</a></li>
<li><a href="">menu 2</a>
<ul>
<li><a href="">Sous menu 2.1</a></li>
<li><a href="">Sous menu 2.2</a></li>
</ul>
</li>
<li><a href="">menu 3</a></li>
<li><a href="">menu 4</a></li>
<li><a href="">menu 5</a></li>
</ul>
</div>
</body>
</html>
Hy,
I run for several hours on a bug ie6, it was not the only one that I was locking it remains only to solve this one and I would finally be quiet.
I have a vertical menu that I built, the problem is that the second level menu does not overlap with that of the first level despite the z-index. Under FF is impeccable, in ie6 it fair.
here is my code, if you could help you relieve me greatly:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title></title>
</head>
<style type="text/css">
<!--
* {
margin: 0;
padding: 0;
}
div#menu {
width: 100px;
}
div#menu ul {
padding: 0;
width: 100px;
border: 1px solid green;
margin: 0px;
background: yellow url();
position: absolute;
z-index: 1;
}
div#menu ul li {
position: relative;
list-style: none;
}
div#menu ul ul {
position: absolute;
top: 0px;
left: 10px;
display: block;
background: red url();
z-index: 999;
border: 1px solid black;
}
div#menu li a {
text-decoration: none;
}
//-->
</style>
<body>
<div id="menu">
<ul>
<li><a href="">menu 1</a></li>
<li><a href="">menu 2</a>
<ul>
<li><a href="">Sous menu 2.1</a></li>
<li><a href="">Sous menu 2.2</a></li>
</ul>
</li>
<li><a href="">menu 3</a></li>
<li><a href="">menu 4</a></li>
<li><a href="">menu 5</a></li>
</ul>
</div>
</body>
</html>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
试试这个插件: http://docs.jquery.com/Plugins/bgiframe ,会起作用的!
用法:$('.your-dropdown-menu').bgiframe();
try this plugin: http://docs.jquery.com/Plugins/bgiframe , will work!
usage: $('.your-dropdown-menu').bgiframe();
试试这个
Try this
ie6 工作在相对位置而不是绝对位置
请检查这一点
ie6 work on position relative more than absolute
Please check this one