ie7 position:fixed and margin-top bug

imagine you want a fixed layer at the top of your page and all which follows to scroll UNDER that layer.
Apparently explorer 7 is unable to calculate a top margin for a 'position:relative' div which follows a 'position:fixed' one with higher z-index. The second layer will just stick to the top of the page no matter which marin-top you define for it.

Test page Workaround is not included
Reported by: feragnoli.

Explorer 7 | Reported on 28 March 2007.

This site is no longer maintained. I’m sorry, but it’s just too much work for too little return. You can continue to browse old bug reports, though.

Search reports by browser:

Atom RSS


(Add your own)

1 Posted by Merri on 28 March 2007 | Permalink

This bug is triggered by the internal hasLayout. By not using any values that triggers hasLayout in to the lower element (such as width and height), then IE7 works correctly.

As a side note: most often you don't need to define width and height for the content element in exactly that kind of layout.

2 Posted by MyCroft on 1 July 2007 | Permalink

You can trick it over by using position: relative and top: 150px, instead of maring-top: 150px for example.

It works both for IE7 and FF