ie6 和 7 中的 z-index 问题

发布于 2024-08-24 11:56:20 字数 258 浏览 2 评论 0原文

在此页面上 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

凡间太子 2024-08-31 11:56:20

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 the window 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.

苏大泽ㄣ 2024-08-31 11:56:20

因为在 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.

○愚か者の日 2024-08-31 11:56:20

嘿,在哪里。哦,简单的快乐就是 Internet Explorer...问题源于 IE7(及更早版本)重置绝对定位元素的 z-index

关于这个问题的一些文献:

两种流行的思维模式似乎要么是通过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:

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!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文