开发者

Cant get z-indexing to work to IE7

开发者 https://www.devze.com 2023-02-07 16:55 出处:网络
The nav works the same in every browser i\'ve tested on a mac and pc; however, I cant for 开发者_JS百科the life of me figure out why in IE7 the nav is appearing under the content in the main content b

The nav works the same in every browser i've tested on a mac and pc; however, I cant for 开发者_JS百科the life of me figure out why in IE7 the nav is appearing under the content in the main content block. Check out http://obs4.dynapp.net/ to see the problem, it only exist in IE7. Check out the source if your interested in helping out with the problem. I dunno, I've spent hours staring at html/css and cant figure anything out.

http://obs4.dynapp.net/


This is a seriously annoying IE7 bug. It occurs because positioned elements later in the DOM will be given priority over those earlier in the DOM, regardless of z-index status.

This article will explain how to fix it: http://thedesignspace.net/MT2archives/000763.html

Basically, add position and z-index to the least common ancestor. So, if your header and content are both contained in a container, add position and z-index to that container. If they're direct children of the body, add it to the body.

Hope that helps.


z-indexing is weird with IE7. You have position: absolute for your nav. You have position: relative for your content. Yes, z-indexing should work where your position doesn't matter, but IE7 will take that into affect and give you two different "stacks" for z-indexes so absolute and relative positioned elements do not interact with each other. Try giving your nav a position: relative instead and then readjusting your css accordingly.

0

精彩评论

暂无评论...
验证码 换一张
取 消