Internet Explorer 7 CSS Menu positioning

让人想犯罪 __ 提交于 2019-12-12 02:26:45

问题


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:

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


回答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.



回答2:


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


来源:https://stackoverflow.com/questions/7449773/internet-explorer-7-css-menu-positioning

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!