Bjørn Enki’s web design blog

Internet Explorer 6 double margin bug fix on floated elements

Internet Explorer 6 (IE6) effectively doubles margin values on floated elements. As a work-around to this bug, simply add "display:inline" to the floated element with the margin.

Internet Explorer 6 double margin bug fix on floated elements

This is mostly for future reference in case I forget, but I'm sure there's someone else out there who will be searching for a solution to the "double margin" bug in Internet Explorer 6 (IE6). 

All you need to do is add "display:inline" to the floated element with the margin that is getting doubled.

There's also a JavaScript solution, but I would personally rather just add a CSS rule for Internet Explorer 6 (until the old browser finally dies out).

Posted Jun. 5, 2009 at 7:22 pm under: website development, css, web browsers, ie6

Leave a response!