CSS HasLayout IE7 错误 - 尝试隐藏缩放和溢出

标签 css internet-explorer debugging internet-explorer-7 haslayout

问题 我已经尝试了很多方法来使 position: relative/absolute/fixed 在 IE7 中工作。我现在无法解决这个问题。

.levelTwo 是具有 pos: ab 的元素,.levelOne 是具有 pos: rel 的元素>。

因此,期望的结果将是任何 .levelTwo 元素位于任何其他元素之上/前面。目前他们坐在 .levelOne a

后面

标记

    <!-- Bof Level One-->
    <ul class="levelOne">
        <li><a href="#">Basic IT Access <span>&#9658;</span></a>
            <div class="levelTwo">
                jamie
            </div>
        </li>
    </ul>

CSS

.levelOne {
    border-top: 1px solid #DDD;
    list-style: none;
    position: relative;
}

.levelTwo {
    left: 157px;
    position: absolute;
    top: 0;
    background: #FFF;
    height: 40px;
    width: 170px;
    z-index: 10;
    /*tried*/
    display: inline-block;
    *zoom:1;
    overflow:hidden
}

需要

Desired

splinter

Broken

这是我的 fiddle : http://jsfiddle.net/hutber/2GvA4/

最佳答案

尝试下面的 css 规则你的问题将解决

CSS:

.head0 .levelOne li { z-index:60; }
.head1 .levelOne li { z-index:50; }
.head2 .levelOne li { z-index:40; }
.head3 .levelOne li { z-index:30; }
.head4 .levelOne li { z-index:20; }
.head5 .levelOne li { z-index:10; }

.levelTwo {
    left: 157px;
    position: absolute;
    top: 0;
    background: #FFF;
    height: 40px;
    width: 162px; /* reduced the width here */
    display: block;
    z-index: 10;
}

屏幕截图:

enter image description here

引用链接:

http://therealcrisp.xs4all.nl/meuk/IE-zindexbug.html
http://css-discuss.incutio.com/wiki/Overlapping_And_ZIndex
http://www.quirksmode.org/bugreports/archives/2006/01/Explorer_z_index_bug.html
http://brenelz.com/blog/squish-the-internet-explorer-z-index-bug/
http://www.satzansatz.de/cssd/onhavinglayout.html
http://www.satzansatz.de/cssd/onhavinglayout.html#rp

关于CSS HasLayout IE7 错误 - 尝试隐藏缩放和溢出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14960872/

相关文章:

c++ - Ubuntu - 在 CLion 中调试以代码 127 退出

css - 将列表项显示为列

css - 如何制作带斜边的 div?

html - 如何只为所有版本的ie添加margin-top样式

html - 奇怪的 IE 错误 - Wordpress 主题

javascript - "create-react-app"调试在 WebStorm 中不起作用

javascript - 安装 Waypoints 和 Animate.css

css - DIV 内没有填充问题

css - Bootstrap glyphicon 出现但 IE11 抛出 CSS3111 错误

c - 用于调试信息的默认链接描述文件