W3C home > Mailing lists > Public > www-style@w3.org > September 2011

[css3-multicol] should spanner margins collapse?

From: Håkon Wium Lie <howcome@opera.com>
Date: Thu, 29 Sep 2011 14:06:54 +0200
Message-ID: <20100.24414.435463.964397@gargle.gargle.HOWL>
To: www-style@w3.org
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>
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
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


  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.

Feedback appreciated.

[1] http://www.w3.org/TR/css3-multicol/#column-span0

              Håkon Wium Lie                          CTO °þe®ª
howcome@opera.com                  http://people.opera.com/howcome
Received on Thursday, 29 September 2011 12:07:33 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:04 UTC