Re: [CSS2.1] Clarifying 8.3.1 Collapsing Margins

fantasai wrote:
> On 09/14/2010 04:44 PM, L. David Baron wrote:
>> On Thursday 2010-08-19 11:36 -0700, fantasai wrote:
>>> This is for CSS2.1 Issue 159
>>>    http://wiki.csswg.org/spec/css2.1#issue-159
>>> triggered by this email
>>>    http://lists.w3.org/Archives/Public/www-style/2010Feb/0015.html
>>>
[snip]
>>>   | Margins that combine this way are said to<dfn>collapse</dfn>, and
>>>   | the resulting combined margin is called a<dfn>collapsed 
>>> margin</dfn>.
>>>   |
>>>   | Adjoining vertical margins collapse, except:
>>>   |   * Margins of the root element's box do not collapse.
>>>   |   * If the top and bottom margins of an element with clearance are
>>>   |     adjoining, its margins collapse with the adjoining margins of
>>>   |     following siblings but that resulting margin does not collapse
>>>   |     with the bottom margin of the parent block.
>>>   | Horizontal margins never collapse.
>>>   |
>>>   | Two margins are adjoining if and only if:
>>>   |   * both belong to normal-flow block-level boxes that participate
>>>   |     in the same block formatting context
>>
>> Since we don't actually define "participate in" a block formatting
>> context, I think it's important to also say here that neither of the
>> boxes is the box that establishes the block formatting context.
> 
> I would prefer to define participation in a block formatting context,
> since the margins of boxes that establish block formatting contexts
> can and do collapse e.g. with siblings or parents, and that makes
> this requirement hard to word...
[snip]
> ~fantasai


I agree with David here.

An element that itself establishes a block formatting context (a 
float) *does not collapse* with it's parent.

Neither of the exceptions (or clauses) below seen in the prose of your 
next message by you in this thread [1] take the above situation into 
account.


  |  * Vertical margins between a floated box and any other box do not
  |    collapse (not even between a float and its in-flow children).
  |  * Vertical margins of elements that establish new block formatting
  |    contexts (such as floats and elements with 'overflow' other than
  |    'visible') do not collapse with their in-flow children.


This is why David writes "I think it's important to also say here that 
neither of the boxes is the box that establishes the block formatting 
context."

BTW, what is the change in version 5 [2]?


1. <http://lists.w3.org/Archives/Public/www-style/2010Sep/0442.html>
2. <http://lists.w3.org/Archives/Public/www-style/2010Sep/0443.html>


-- 
Alan http://css-class.com/

Armies Cannot Stop An Idea Whose Time Has Come. - Victor Hugo

Received on Wednesday, 15 September 2010 09:31:16 UTC