CSS - IE 7 z-index 问题
祝大家美好的一天。我有一个下拉菜单(一个div实际上在搜索栏上的onclick事件中显示为none)放置在具有以下样式的div内:
background-image: url("/whatever.png");
height: 80px;
position: relative;
top: 60px;
width: 100%;
出现的div(下拉菜单)有:
background: none repeat scroll 0 0 #FFFFFF;
border: 1px solid;
height: 185px;
left: 140px;
padding-top: 3px;
position: absolute;
top: 25px;
width: 134px;
z-index: 25;
现在...这是问题(我不得不隐藏一些元素,对此感到抱歉,我也无法提供在线副本,对此也感到抱歉):
红线是与下拉菜单的容器处于同一级别的 div,其样式:
top: 140px;
width: 100%;
蓝色条(是放置在其他 2 个 div 内的 div,其位置:相对且浮动:左侧,没有其他内容)具有:
background: url("blue.png") repeat scroll 0 0 #00FF00;
color: #FFFFFF;
float: left;
font-size: 12px;
font-weight: bold;
height: 22px;
margin-top: 20px;
padding-top: 5px;
position: relative;
text-align: center;
text-transform: uppercase;
width: 210px;
这只发生在IE 7 和 6。在所有其他浏览器上都可以。任何帮助将不胜感激。
Good day to all. I have a dropdown menu (a div actually with display:none at onclick event on the searchbar it appears) placed inside a div with the following style:
background-image: url("/whatever.png");
height: 80px;
position: relative;
top: 60px;
width: 100%;
The div that appears (the dropdown) has:
background: none repeat scroll 0 0 #FFFFFF;
border: 1px solid;
height: 185px;
left: 140px;
padding-top: 3px;
position: absolute;
top: 25px;
width: 134px;
z-index: 25;
Now... here is the problem (I had to hide some elements sorry about that also I can not provide an online copy sorry about that too):
The red line is a div on the same level as the container of the dropdown with style:
top: 140px;
width: 100%;
The blue bar (is a div placed inside 2 other divs with position: relative and float: left, nothing else) has:
background: url("blue.png") repeat scroll 0 0 #00FF00;
color: #FFFFFF;
float: left;
font-size: 12px;
font-weight: bold;
height: 22px;
margin-top: 20px;
padding-top: 5px;
position: relative;
text-align: center;
text-transform: uppercase;
width: 210px;
This only occurs on IE 7 and 6. Is ok on all other browsers. Any help would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将
z-index: 50;
添加到父(容器)div。Add
z-index: 50;
to the parent (container) div.