View Full Version : Moving menu (in IE, not Firefox)

05-30-2007, 12:51 PM
I've scoured the forums and either I'm using the wrong search terms or this problem has arisen before, so here goes...

Please see www.littlefishbristol.com/_index.htm for the offending page. It works fine in Firefox, but I'm obviously in need of some kind of hack for IE.

The page looks near enough how I want it to, but when you resize the window in IE, the menu stays where it was in the previsouly sized screen until you mouseover it... Make sense? This doesn't happen in Firefox, it all just plays happily as it should.

Any suggestions would be greatly appreciated. I've used someone elses menu so wondering if it's some kind of clash between their CSS and mine.

Thanks in advance.


06-04-2007, 12:00 AM
That's an IE bug (at least IE6 and IE7 affected). Loosely stated, any relative or absolutely positioned element behaves as if it is fixed with respect to the html element unless there is some positioned element between them.

Emil Stenström has reporten the bug here in its simplest form: http://friendlybit.com/css/ie6-resize-bug/
It also contains the fix which is to use body {position: relative}

Although I wouldn't recommend using the method, the bug has been exploited by Stu Nicholls to emulate fixed positioning in IE6: http://www.cssplay.co.uk/layouts/fixed.html

06-13-2007, 08:43 PM
Perfect, just added position:relative to the body tag and it fixed it straight away. Great tip, thanks.