- From: Håkon Wium Lie <howcome@opera.com>
- Date: Fri, 20 Sep 2013 19:11:00 +0200
- To: www-style@gtalbot.org
- Cc: "W3C www-style mailing list" <www-style@w3.org>
Gérard Talbot wrote:
> One issue that I wish would be explicit and clarified in the spec is if
> margin collapsing can occur between a column-spanning element and blocks
> in column boxes. If it can occur, then the spec should say so, then define
> under which conditions along with an example. If it does not occur, then
> the spec should say so.
The answer is: yes, margin collapsing occur as per the normal rules.
That is, margin collapsing will not to through the content/border box
of a spanner or a multicol element (both are BFCs), but the margins of
a spanner will collapse with its surroundings.
I don't want to add normative text about this as it's a terribly
complex part of CSS 2.1 and the multicol spec should not try repeat it
or change it. But having an example makes sense -- I've added an
example 26 in the current ED:
http://dev.w3.org/csswg/css-multicol/#column-span
> Here's a test where browsers differ:
>
> http://www.gtalbot.org/BrowserBugsSection/CSS3Multi-Columns/Opera/NewTests/multicol-spanning-margin-collapsing-234.xht
>
> (
> This test is a modified and customized test from Example XX in
> http://www.w3.org/TR/css3-multicol/#column-span
> and in Example 22 in
> http://dev.w3.org/csswg/css-multicol/#column-span
> )
>
> Firefox 23 does not support column-span: all, so here, I am only taken
> into consideration IE10, IE11 (preview), Chrome 29.0.1547.65 and Opera
> 12.16.
>
> The issue involves the margin collapsing of the margin-bottom of the
> h2#column-spanning which is 80px with the margin-top (which is 40px) of
> the p in first column box.
Yes, margin collapsing should occur there.
> If margin collapsing occurs between those 2 margins, then there should be
> an 80px (max(80px, 40px)) tall blue area. IE10 and IE11 do that. (Prince9
> also does that but it fails to render the margin-top of first p.)
>
> If margin collapsing does not occur (because it should not occur) between
> those 2 margins, then there should be an 120px (80px + 40px) tall blue
> area. Chrome 29.0.1547.65 and Opera 12.16 do that.
>
> If margin collapsing can occur between column-spanning element and blocks
> in column boxes, then it could be possible to create tests where several
> blocks' margin-top collapses with a preceding-sibling column-spanning
> element.
Yes, but remember that margins are trucated after a natural break:
http://dev.w3.org/csswg/css-break/#break-margins
> If margin collapsing can occur between column-spanning element and blocks
> in column boxes, then it could be also possible to create tests where
> several blocks' margin-bottom collapses with a following-sibling
> column-spanning element.
>
> Another sub-issue is: can margin collapsing occur between 2
> vertically-adjacent (following sibling) column-spanning elements.
Yes.
-h&kon
Håkon Wium Lie CTO °þe®ª
howcome@opera.com http://people.opera.com/howcome
Received on Friday, 20 September 2013 17:11:37 UTC