Friday, September 15, 2006

Left margin is doubling on floating DIVs

I stumbled across this today, while looking up an unrelated issue to do with DIV appearance in Firefox actually. Anyway, the old, doubling of the left margin was something I was experiencing in the same web page, so I was going to get around to hunting that one down too, and there it was.

The problem occurs in IE, when you set a left margin value on a DIV that contains other DIVs, but only when those other DIVs are set to float:left. (Apparently it's the same for the right margin, if DIVs are set to float:right). Anyway, Holly 'n John to a much better job of explaining this, here.