Internet Explorer 7 CSS 菜单定位

发布于 2024-12-05 01:37:22 字数 390 浏览 4 评论 0原文

我用 HTML 和 CSS 创建了一个适用于所有主要浏览器(Chrome、Firefox、IE8+ 和 Safari)的菜单。您可以在这里找到它:http://www.calvaryccm.com/MenuTest.aspx

IE 7 中出现问题。

我有一个悬停菜单,使用一些 JS 来实现效果。当我尝试在 IE7 中渲染它时,会发生以下情况:

IE 7 Menu Error

我需要一些帮助来确定如何定位文本下方的菜单。感谢您的帮助!

I have created a menu in HTML and CSS that works in all the major browsers (Chrome, Firefox, IE8+, and Safari). You can find it here: http://www.calvaryccm.com/MenuTest.aspx

The problem occurs in IE 7.

I have a hover menu using some JS for effect. When I try to render it in IE7 this is what happens:

IE 7 Menu Error

I need some help figuring out how to position the menu under the text. Thank you for your help!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

提笔书几行 2024-12-12 01:37:22

我不确定您是否想在下面的选择器中使用 .block 还是 .nav。我选择了 .block 因为我可以看到它被应用到元素上。

  • .block ul 上,删除 overflow:hidden
  • .block li 上,添加 position:relative
  • .block ul.nav ul 上,添加 left: 0

您现在拥有臭名昭著的IE6/7 z-index 问题

  • 要修复这种情况,请在 .block ul 上添加 position:relative; z 索引:3
  • z-index: 3#player-area 上的 z-index 高 1。

I'm not sure whether you want to use .block or .nav in the selectors below. I've gone with .block because I can see it being applied to the element.

  • On .block ul, remove overflow: hidden.
  • On .block li, add position: relative.
  • On .block ul.nav ul, add left: 0.

You now have the infamous IE6/7 z-index problem:

  • To fix it in this case, on .block ul, add position: relative; z-index: 3.
  • z-index: 3 to be one higher than the z-index on #player-area.
禾厶谷欠 2024-12-12 01:37:22

另外,您不需要像您所做的那样使用 javascript 添加“hover”类。只需在 CSS 中使用 :hover 伪选择器即可:

ul.nav > li:hover

Also, you don't need to use javascript to add the 'hover' class as you've done. Just use the :hover pseudo selector in CSS:

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