我有两个尺寸相同的 div。一个 div 放在另一个之上。每当我需要反转时,我都会为另一个 div 分配 z-index。它在 chrome 中运行良好。但是在 Internet Explorer 中,z-index: -1
元素被完全隐藏了。为什么会这样?我使用最新的 Internet Explorer 10 对此进行了测试。你们中的任何人以前发生过这种情况吗?
最佳答案
将 z-indexes 保持为正数。我会给你的元素分配一个默认的 z-index,然后有一个你添加到其中一个或另一个(使用 jquery 等)的显示类,使 z-index 更高。
.item { z-index: 10; }
.item.display { z-index: 20; }
关于html - Internet Explorer 中的 z-index 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19838572/