W3C home > Mailing lists > Public > www-style@w3.org > August 2004

Re: [CSS21] 3 margin-collapse issues?

From: Ian Hickson <ian@hixie.ch>
Date: Mon, 23 Aug 2004 13:59:37 +0000 (UTC)
To: Staffan Måhlén <staffan.mahlen@comhem.se>
Cc: www-style@w3.org
Message-ID: <Pine.LNX.4.61.0408231354570.812@dhalsim.dreamhost.com>
On Mon, 9 Aug 2004, [ISO-8859-1] Staffan Mhln wrote:
> It seems to lack the case "display: table-cell". If that is correct, the 
> section could probably be simplified by just referring to elements that 
> create a new block formatting context when stating what elements never 
> participate in a margin collapse.

Table cells don't have margins, so they can't be adjoining to anything, 
and if they're not adjoining to anything, they don't collapse.

> It also seems to miss specifying what happens with vertical overflow and 
> bottom-margin. It does specify that collapse with bottom margin and 
> children does not occur if "underflow" occurs, but not that it doesn't 
> when overflow happens which seems to be the interpretation of some major 
> current implementations and also makes more sense than collapsing 
> something that isen't adjoining.

When overflow happens, the margins aren't adjoining. This is defined.

> The paragraphs: 
> "If the element's margins are collapsed with its parent's top margin, 
> the top border edge of the box is defined to be the same as the 
> parent's. Otherwise, either the element's parent is not taking part in 
> the margin collapsing, or only the parent's bottom margin is involved. 
> The position of the element's top border edge is the same as it would 
> have been if the element had a non-zero top border."
> does not seem to match exactly what current browsers do. Why have two 
> ways to position the element and why isn't the box always positioned 
> after the collapse? To me it seems weird that the elements content area 
> can start above where its margins participates in a collapse, but 
> otherwise i think most implementations seem to go with some version of 
> the second solution above? This case is however probably the defintion 
> of an edge case,

The case above is only relevant when the top and bottom margins of an 
element collapse together. If it wasn't for those paragraph, there would 
be no defined top border content edge for that element, and nested floats 
or positioned elements would be at a loss as to where to go.

The two definitions are needed because otherwise you end up with 
unintuitive results.

Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Monday, 23 August 2004 13:59:40 UTC

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:13:07 UTC