- From: Anton Prowse <prowse@moonhenge.net>
- Date: Wed, 19 Oct 2011 16:07:41 +0200
- To: www-style@w3.org
On 29/09/2011 14:06, Håkon Wium Lie wrote:
> The CSS WG is discussing margin collapsing on spanning elements
> ("spanners") and would like some feedback. The basic question is:
> should margins set on consecutive spanners collapse?
>
> Consider this markup:
>
> <div class=multicol>
> <h1>Heading</h1>
> <h2>Subheading</h2>
> <p>............
> </div>
>
> And this styling:
>
> div.multicol { columns: 10em; border: ... }
> h1, h2 { column-span: all; margin: 1em 0 }
>
> If the browser doesn't support multicol, margin collapsing would occur
> between the h1, h2, and p elements.
>
> If the browser supports multicol, the content of<p> will appear in
> multiple columns, and the spanners will stretch across. The rendering
> could be something like:
>
> ___________________________________
> | |
> | Heading |
> | |
> | Subheading |
> | |
> | ............... ............... |
> | ............... ............... |
> | ............... ............... |
> |___________________________________|
>
> In the above ascii art, the margins between the h1 an h2 elements have
> collapsed.
>
> A releated issue is how to deal with floats; should floats be able to
> cross over from one spanner to the next?
>
> Thee WG has three possible solutions to this issue. Here's a comparison:
>
> Do spanners create BFCs? MC XF MC-c
>
> (a) no, but (consecutive) spanners yes yes yes
> with identical column-span value
> are wrapped into one anonymous BFC
>
> (b) yes, but the margins of the BFC no no no
> don't collapse (unlike other BFCs)
>
> (c) yes, and they collapse as other BFCs yes no no
>
> where
>
> BFC = block formatting context
> MC = margin-collapse between consecutive spanners
> XF = cross floats between consecutive spanners
> MC-c = margin-collaps between consecutive spanners, including children
>
> The specification [1] today suggests (c). But it can be changed if,
> e.g., XF or MC-c are important to authors. Are they?
>
> Or, we could do (b) if authors would rather avoid MC/XF in multicol.
> One argument in favor of this is: If we add integer values to
> 'column-span' in the future, the spanners become more like floats. And
> floats don't do MC/XF.
Given the primary use case (headings that span all columns) I think we
should defer to typical print usage where that use case is quite common.
It appears to me that margins between consecutive spanners /do/
collapse in print contexts. This would rule out option (b).
I don't see much similarity between spanners and floats. To my mind, a
2-column spanner doesn't behave like a float, because the spanner
remains in flow and hence there is no concept of surrounding content
breaking around it. Something that would be more similar to floats
would be pull-quotes (where I think I would expect no collapsing with
surrounding content) but that's not what spanners are.
My preference is (a) because I don't see any reason not to make the
behaviour of multicol as close as possible to the CSS21 behaviour, which
would aid authors trying to support both modern (multicol-aware) and
legacy UAs with the same stylesheet.
Cheers,
Anton Prowse
http://dev.moonhenge.net
Received on Wednesday, 19 October 2011 14:07:05 UTC