Undercrank

CSS

April 6, 2004

Fixing the double margin bug in IE

The ridiculous double margin bug that affects Internet Explorer finally has a cure. For those that haven't seen it before, the gist is that sometimes an element that has a margin: and a float: property applied to it, instantly doubles the size of the margin value that matches the float - in other words, an element with a 10px left margin that also floats left, would mysteriously end up with a 20px left margin instead.

Anyway, Steve Clason seems to have found the solution to this and documented it at Position Is Everything. Fortunately, it's simple indeed - you set the element to have a display: property of inline and subsequently setting float: left; implicitly changes the element back into a block element again.

Which then stops the margin from doubling in size. Somehow.

More of the same RSS

Internet Explorer 7

Dean Edwards has put together a set of scripts that add some sorely lacking functionality from IE5.5 and IE6.0.

'Nuff Said

Why tables for layout is stupid.

Media rules in Internet Explorer 5.0

It's probably well documented elsewhere, but another CSS failing in Internet Explorer came up for me today. IE5.5 (and I presume, earlier) fail to properly respect the media attribute within a style tag. For example, in the following code IE5.x...

Internet Explorer's "Double Margin" bug

Another Internet Explorer rendering bug. This one causes margins to double in size when an element is floated left.

Trackbacks

Trackback URL for this entry is:

Post a comment

Remember personal info?