我的页脚中的按钮在IE中不起作用。我认为这与z-index有关。当前页脚设置为-1,主要内容设置为1。我搜索了堆栈溢出,并看到了许多有关z-index和IE的帖子。这里也是如此吗?Link to website。两个CSS类看起来像这样:
.main-content {
background: #f5f2eb;
background: var(--background, #f5f2eb);
min-height:0vh;
padding: 0;
padding-top: 80px;
z-index:1;
}
footer {
padding-top: 100px;
position:fixed;
bottom:0;
left:0;
width:100%;
height:380px;
background: rgb(255, 115, 50);
background: var(--footer, rgb(255, 115, 50));
color:#fff;
z-index:-1;
}
根据您的描述,我试图运行您的代码。我按下了按钮,好像网站中有什么阻止它。
我认为应该是Z索引级别的问题。最外面的Z索引受IE的限制。不管内部Z索引有多高,都不能超过外部Z。
您可以尝试将正文中的每个级别分开,如下所示:
<style> *{margin:0;padding:0;} .contain{width:300px;height:300px;margin:50px;color:#fff;background:#609;position:relative;} .box1{width:100px;height:100px;background:#FC0;position:absolute;top:200px;left:100px;z-index:20;} .box2{width:100%;height:100%;background:#ccc;opacity:0.6;filter:Alpha(opacity=60);position:absolute;top:0;left:0;z-index:10;} </style>
<body> <div class="contain">Parent (first level)</div> <div class="box1">Top pop up (third level)</div> <div class="box2">Transparent overlay (second level)</div> <!-- <div class="contain">Parent (first level) <div class="box1">Top pop up (third level)</div> </div> <div class="box2">Transparent overlay (second level)</div> --> </body>
此外,您也可以尝试检查relevant IE settings。