gpt4 book ai didi

css - z-index 在 IE 中不起作用

转载 作者:行者123 更新时间:2023-11-28 10:57:37 25 4
gpt4 key购买 nike

IE版本为6.0,代码如下:

<div style="background-color: #4A840F; width:300px; height: 200px; position: relative;">
<div style="background-color: #ED4100; width:200px; height: 500px; position: absolute;z-index: 100;"></div>
</div>
<div style="background-color: red; width:300px; height: 200px; position: relative;"></div>

如果我删除第三个 div 上的 position=relative,一切正常,但我不能,因为我需要它来修复另一个元素。但是,如果不删除它,则 z-index 在 IE 中不起作用。它适用于 FF 和 chrome。

有人可以帮我解决一下吗?提前谢谢你。

最佳答案

添加

z-index: 1;

到第一个 div 的样式。

在 IE6 中,偏移父级的 z-index 将覆盖其所有子级的 z-index 值。

关于css - z-index 在 IE 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4858589/

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