On Aug 22, 2008, at 8:27 PM, Bobby Jack wrote:

> According to the CSS2.1 spec "Vertical margins between a floated box  
> and any other box do not collapse", yet my testing reveals that, in  
> the following arrangement:
>
> 1. a normal paragraph
> 2. a floated paragraph
> 3. a cleared paragraph
>
> margins collapse between 2 and 3, but not between 1 and 2. At least,  
> this is the case for FF2 and Opera9, whilst IE7 does not collapse  
> either set of margins.
>
> Who is right, have I misunderstood this part of the spec., or is  
> something else coming into play?
>
> Example at:
>
> http://www.fiveminuteargument.com/collapsing-margins-after-float

There is indeed something else: the margin-bottom between the floated  
paragraph (10px) does not collapse with the margin-top of the next  
paragraph.

What happens here is 'clearance' (specified on paragraph 3 in the test  
case). That 'clearing' can be understood as 'extend the margin-top of  
the clearing element (parag 3) enough to get it past the floated  
element'.

The margin-top of paragraph 3 actually collapses with the margin- 
bottom of paragraph 1, but is then extended by the used height +  
margins of paragraph 2.
<http://www.w3.org/TR/CSS21/visuren.html#flow-control>

Philippe
---
Philippe Wittenbergh
http://l-c-n.com/





______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to