View Full Version : simple CSS question

05-29-2007, 02:07 AM
I am having a bit of an issue with gaps in my DIVs on www.ckmca.com (http://www.ckmca.com) when viewed in firefox

as far as i can tell the margins are set to 0 yet there are still appearing.

the only way i have found to eliminate the gaps is to set my margins to -21 (top)

im sure there is a better way, and have look through this forum and my code to see whats wrong but i just dont get it.

any advice?


05-29-2007, 02:33 AM
This is due to margin collapsing (http://www.w3.org/TR/CSS21/box.html#collapsing-margins).

It may seem weird that the top margin of the h1 element should reside outside the parent elements content area, but this is what the specification says should happen when the parent has no top border or padding. Same thing holds for bottom margins.


h1 {
margin: 0;

05-29-2007, 07:02 AM

it work great...now all i need is some more content for my site :)