ie6 和 7 中的 z-index 问题
在此页面上 http://equals.lsri.nottingham.ac.uk/puzzle/create ,如果您在输入中输入内容,然后单击“保存”,则会弹出一个自定义对话框。但即使对话框的 z-index 及其容器的 z-index 高于方程编辑器,编辑器仍然与 ie6 和 7 中的对话框重叠。有人知道为什么吗?
On this page http://equals.lsri.nottingham.ac.uk/puzzle/create, if you type something into an input and then click save a custom dialog will pop up. But even though the dialog's z-index, and that of its container, are higher than that of the equation editor, the editor still overlaps the dialog in ie6 and 7. Anyone got any idea why?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
z-index 是相对于其容器的。因此,如果某个东西是绝对定位的,那么它的容器就是
窗口
,但如果它是相对定位的,那么它的 z 索引仅相对于该容器中的其他东西。因此,window
中的最高值就是它的父级。如果您的重叠元素是绝对的,则您需要将新元素容器置于更高的 z 索引处,或者将新元素绝对定位。z-index is relative to its container. So if something is absolutely positioned, it's container is the
window
, but if it's relatively positioned its z-index is relative to only the other things in that container. So the highest it could be in thewindow
is whatever it's parent is. If your overlapping element is absolute, you either need the new elements container at a higher z-index or absolutely position the new elements.因为在 IE 6 和 7S 中,堆叠的工作方式不同。请参阅 quirksmode 上的错误报告:Explorer z-index 错误。 org,以及一些解决方案的评论。
Because in IE 6 and 7S, stacking works differently. See Bug report: Explorer z-index bug on quirksmode.org, and the comments for some solutions.
嘿,在哪里。哦,简单的快乐就是 Internet Explorer...问题源于 IE7(及更早版本)重置绝对定位元素的
z-index
。关于这个问题的一些文献:
Bug
两种流行的思维模式似乎要么是通过JavaScript来修正(Prototype和jQuery都有第二篇文章列出的解决方案),要么是通过包装你想要的绝对定位元素位于具有高 z-index 的非绝对定位父级的顶部。哈!
Hey, wheresrhys. Oh, the simple joy that is Internet Explorer... The problem stems from the fact that IE7 (and earlier) resets the
z-index
of absolutely positioned elements.Some literature on the issue:
Bug
The two popular modes of thought seem to either be correction through JavaScript (both Prototype and jQuery have solutions listed in the second article), or by wrapping the absolutely positioned element you want on top in a not absolutely positioned parent that has a high
z-index
. Hth!