Re: [css21] Collapsing margins

At 03:03 AM 2/21/2006, Andrew Fedoniouk wrote:
>>|> "If the top and bottom margins of a box are adjoining, then it is
>>|> possible for margins to collapse through it."
>>|
>>|> So it could be literally read as:
>>|> "margins of a zero height box may collapse through it"
>>|
>>Yeah, looking at the spec, that point is describing the situation where
>>the block element has no height, and therefore the top and bottom
>>margins are right next to each other (and collapse together).  That's
>>why it uses the singular "box".
>
>Kelly, beg my pardon, but your explanation makes things even worse for me:
>"are right next to each other (and collapse together)."
>
>Either they [are] next to each other [or] they collapse (overlap).

A very lengthy recasting of this sentence might read: "If laid out in 
the absence of this rule, the top and bottom margins of a box may be 
adjacent.  This may only happen when the box is of zero computed 
height, there are no clearances applied to the box, and there are no 
intervening padding or borders.  In such a case, this rule specifies 
that those margins which would otherwise have been adjacent will 
instead collapse with each other and with other otherwise adjacent margins."

Personally, I think the original phrasing is considerably more elegant.

>The only situation when "If the top and bottom margins of a box are 
>adjoining" is then box has zero height.  Why not just say so?

Because while your phrasing may be deduced from the original, the 
inverse is not true: a zero-height box may nevertheless not have 
adjoining top and bottom margins.  Thus the phrase "may collapse" in 
your statement is even less definite than the "it is possible" phrase 
you complained about from the original (which is a necessary hedge to 
account for element clearance, to answer your question on that score).

Incidentally, collapsing margins do not overlap.  They combine to 
become a single margin.

HTH,


-Adam Kuehn 

Received on Tuesday, 21 February 2006 15:31:06 UTC