gpt4 book ai didi

css - IE7 Z-Index 问题

转载 作者:太空宇宙 更新时间:2023-11-04 05:29:13 24 4
gpt4 key购买 nike

在我目前工作的网站上,边栏中有一个嵌套的无序列表,当 <li>从这个列表中悬停,它显示(以前隐藏的) child <ul> .这在除 IE 7+6 之外的所有浏览器中都可以正常工作。在这些浏览器中,弹出窗口 <ul>显示在 <li> 下方上面列表的。知道为什么要这样做吗?

我的 CSS 如下:

div#sidebar-products {
border-bottom: 3px solid #D31245;
height: 297px;
}
div#sidebar-products h2 {
font-size: 1.5em;
border-bottom: 0;
padding: 5px 0 12px 0;
color: #D31245;
}
div#sidebar-products ul{
z-index: 0;
}
div#sidebar-products li{
position: relative;
}
div#sidebar-products ul li a,
div#sidebar-products ul li a:visited
{
display: block;
border-bottom: 1px solid #eeeeee;
text-decoration: none;
padding: 7px 10px 7px 20px;
color: #6b6869;
background: #fff url(/img/raquo-red.png) 7px center no-repeat;
}
div#sidebar-products li a:hover,
div#sidebar-products li a:focus,
div#content-holder div#sidebar-products li.active a
{
background-image: url(/img/raquo-white-red.png);
background-color: #D31245;
color: #fff;
}
div#sidebar-products ul ul{
display: none;
padding-left: 10px;
position: absolute;
margin-top: -1px;
z-index: 9999 !important;
border: 1px solid #D31245;
background: #f3f3f3;
width: 247px;
}
div#sidebar-products ul li ul li {
margin-bottom: 0;
position: static !important;
z-index: 500;
}
div#site-holder div#content-holder div#sidebar-products ul ul li a {
background: #fff url(/img/raquo-red.png) 10px center no-repeat;
padding-left: 24px;
color: #949494;
}
div#site-holder div#content-holder div#sidebar-products ul li ul li a:hover,
div#site-holder div#content-holder div#sidebar-products ul li ul li a:focus
{
color: #D31245;
background-color: #fff;
}

最佳答案

我想您可能遇到过这样的错误,即 IE 不在文档级别处理 z-index,而是在容器级别处理。我忘记了确切的错误细节,它通常通过添加/删除位置来修复:我相信相对于共享祖先元素。

尝试这些以获得更多细节:

关于css - IE7 Z-Index 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3959728/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com