Wider margin or padding issue in IE6

Posted Oct 13th, 2008 by David Calhoun in browser bugs, css

Not sure why you’re getting wider margins or padding in IE6?  It’s a well-known issue with floating div elements, and it even has a specific name: the double margin (or double padding) bug.

The fix is simple.  Add this CSS rule to the floating Divs:
display: inline;

As an aside, it’s interesting to note that this fix doesn’t work if you’ve forgotten to add a unit value to your margin or padding.  For instance, if you’ve typed “padding: 10″ instead of “padding: 10px”, IE6 still doubles the 10 and presumes the units are in pixels.

Via http://www.jaymeblackmon.com/ie6-double-margin-bug-fix and                          http://www.positioniseverything.net/explorer/floatIndent.html

  • Avery on 19 Nov 2009 at 2:56 am

    this post has inspired me, i need to get back to posting on my blog soon, its so easy to loose track of time aint it.

Trackback URI | Comments RSS

Leave a Reply

Categories