I thought I pretty much understood margin collapse but now I could use some 
clarification.

Take this example:

.boxtop { background: #999; }
.boxbot { background: #ddd; }
h3 { margin-bottom: 0; }

<div class="boxtop">
        <h3>header</h3>
</div>

<div class="boxbot">
        <p>some text here.</p>
</div>

if you're seeing what i'm seeing you'll notice a gap (white) between the 
first and second divs.  now take the same example and add a one pixel border 
to .boxbot so it now reads .boxbot { background: #ddd; border: 1px solid 
red; } you should now see that the gap is filled with the background color 
of the .boxbot div, in this case #ddd.

so here is where i get lost on what is margin and what isn't.  in the second 
example with the border i believe the extra space is infact margin and 
appears because there is a 1px border.  meaning, that 1px border causes the 
margin not to collapse.  but, i'm lost in what's happening in the first 
example. is that gap in the first example margin? if so, is there anyway to 
get rid of the gap other than specifying margin-top: 0; for the paragraph? 
any clarification would be appeciated. thanks! j


______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to