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

时间:2013-02-19 15:15:42

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

问题 我已经尝试了许多方法让position: relative / absolute / fixed在IE7中工作。我现在不能解决这个问题。

.levelTwopos: ab.levelOne元素具有pos: rel的元素。

所以期望的结果将是任何.level要在任何其他元素之上/之前的两个元素。目前他们坐在.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

Broken

继承我的小提琴: http://jsfiddle.net/hutber/2GvA4/

1 个答案:

答案 0 :(得分:3)

尝试以下将解决问题的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