Crazy CSS gaps

Just been playing with a tableless design again, and remember why I’ve shied away from it in the past

webmasterworld
lissaexplains

Anyway, the bit I’d forgotten about was that elements within divs retain their margins! So, even though a div has a margin set as zero, an element within it, such as h1 retains its top and and bottom margins.

I’ve now got some very nice columnar layouts (using floats, and without any absolute positioning), and will either put them up here or at the Icicle Nest.

The box model

The W3C link is still very informative, but I did like the diagram at Hicks Design, too.


Categories ,