IE6 and IE7 Z-INDEX bug

◇◆丶佛笑我妖孽 提交于 2019-12-08 06:11:38

问题


After a few lost days, I have given up trying to solve this. So, here is the situation and I'll be really thankful if someone could tell me what I should do:

I have a vertical menu, and the second level of the menu is absolute positioned. The inner <ul> is styled position: absolute; and has a set z-index. The problem is ie6 and ie7-specific, which does not recognize the z-index in an absolute positioned block. If the element was a relatively positioned, there are no problems but I need the element to be positioned absolute.

Are there any suggestions? Thanks a lot to everyone who's going to give their advice or opinion.


回答1:


Try this if it helps.

Inside absolute div, add a relative div and put your code inside it.




回答2:


IE6 and IE7 have a z-index bug where each absolutely positioned element creates a new context for the stacking order. It's difficult to tell without seeing the html in question, but try adding position: relative; and z-index: 100 (or something above the z-index of your sub-menus) to the container (parent) of all the elements with position: absolute.



来源:https://stackoverflow.com/questions/8128749/ie6-and-ie7-z-index-bug

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