html - Z-index 不适用于 IE

标签 html css internet-explorer internet-explorer-8 z-index

以下代码在 IE 11 中运行良好,但当我在 IE8 上测试页面时,Main_Box 的底部没有与 Intro DIV 的顶部重叠。

如果我从“Intro”中删除背景颜色,我可以看到它后面的 Main_Box 的底部,但我无法让它显示在前面。

我认为这可能是此页面上引用的错误...

Z-index in Internet Explorer not working

...因此尝试将其包装在绝对 DIV 中以重置 z-index,但无济于事。

    <div style="position: relative; z-index: 3000">
<section id="intro">

    <h1>
        EXAMPLES
    </h1>

    <div class="animation-container">
        <div id="object" class="animate fadeIn"></div>
    </div>

    <div id="intro-copy">
        <img src="./images/arrow.png" alt="Arrow" id="arrow" class="pulse" />
        <p>Scroll down</p>
    </div>
</section>
</div>

工作 IE11 HTML:

<section id="main">

    <div class="Main_Box">
    <h10>
        “People often represent the weakest link in the security chain”
    </h10>

    <h2>
        Contact us today to see how we can help.
    </h2>
    </div>

</section>


<section id="intro">

    <h1>
        EXAMPLES
    </h1>

    <div class="animation-container">
        <div id="object" class="animate fadeIn"></div>
    </div>

    <div id="intro-copy">
        <img src="./images/arrow.png" alt="Arrow" id="arrow" class="pulse" />
        <p>Scroll down</p>
    </div>
</section>

CSS

#main{
height: 420px;
width: 100%;
position: relative;
top: 130px;
 }

.Main_Box {
border-width: 5.547px;
border-color: rgb( 255, 255, 255 );
border-style: solid;
border-radius: 10px;
background-image: -moz-linear-gradient( 90deg, rgb(0,0,0) 0%, rgb(27,27,27) 100%);
background-image: -webkit-linear-gradient( 90deg, rgb(0,0,0) 0%, rgb(27,27,27) 100%);
background-image: -ms-linear-gradient( 90deg, rgb(0,0,0) 0%, rgb(27,27,27) 100%);
box-shadow: 2.5px 4.33px 5px 0px rgb( 0, 0, 0 );
position: relative;
width: 70%;
height: 270px;
margin: 0 auto;
position: relative;
z-index: 9999;
padding: 30px;
}


#intro{
height: 650px;
width: 100%;
position: absolute;
background-color: #ffffff;
}

非常感谢任何帮助。

这是我的开发站点的链接:

http://goo.gl/NlAkiU

谢谢,

最佳答案

尝试在部分级别分配 z-index; #main#intro 是 sibling ,因此更有可能在同一个 stacking context 中就遗留浏览器而言。

#main { z-index: 9999; }

关于html - Z-index 不适用于 IE,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24271868/

相关文章:

jquery - 浏览器警报样式

javascript - 拉维尔设计。如何显示检索到的标签

html - 扩展的html模板的背景图片没有加载到html页面中,如何解决这个问题?

html - 强制页面在 Internet Explorer 中打开(不是 Edge/Spartan)

java - 是否可以在 ie 中从 JavaScript 创建任意 Java 对象?

html - 如何有两个 div,一个在父 div 的左侧,另一个在右侧?

javascript - 在php中链接css文件

javascript - 从 Internet Explorer 中的 AJAX 响应中删除了 SCRIPT 标记

html - "GO"移动设备文本区域上的按钮

javascript - 移动 div 无法正常工作