W3C home > Mailing lists > Public > public-css-archive@w3.org > June 2018

[csswg-drafts] [CSS2] Questions about vertical margin and horizontal margin in collapsing margins

From: Patrick Chan via GitHub <sysbot+gh@w3.org>
Date: Tue, 12 Jun 2018 14:27:53 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-331612515-1528813672-sysbot+gh@w3.org>
sakura90 has just created a new issue for https://github.com/w3c/csswg-drafts:

== [CSS2] Questions about vertical margin and horizontal margin in collapsing margins ==
I have questions about collapsing margins at the following section and would like to ask for help:
https://www.w3.org/TR/CSS2/box.html#collapsing-margins

In the section, it writes:

"Adjoining vertical margins collapse, except:
...
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."

Later in the section, it writes:

"Horizontal margins never collapse."

"When two or more margins collapse, the resulting margin width is the maximum of the collapsing margins' widths"

I thought that vertical margins mean margin left and margin right because in 8.3 (https://www.w3.org/TR/CSS2/box.html#margin-properties), "vertical margins will not have any effect on non-replaced inline elements." is written, and above the description of margin-left and margin-right, "These properties have no effect on non-replaced inline elements." is written.

However, the section writes "Adjoining vertical margins collapse...If the top and bottom margins".  I then thought that maybe there was a typo and "vertical margins" mean top and bottom margins, and "horizontal margins" mean left and right margins.  However, later in the section, it writes "Horizontal margins never collapse." and "When two or more margins collapse, the resulting margin width...".  If "Horizontal margins never collapse." means left and right margins never collapse, when two margins collapse, the collapse shouldn't change the margin width.

Could you please tell me in "Adjoining vertical margins collapse", whether or not vertical margins mean margin left and margin right?

If vertical margins mean margin left and margin right in the above question, could you please reply why following  "Adjoining vertical margins collapse", it mentions "the top and bottom margins of an element"?

Could you also please explain why it writes "Horizontal margins never collapse.", but it also writes "If the top and bottom margins of an element with clearance are adjoining, its margins collapse" and  "When two or more margins collapse, the resulting margin width is the maximum of the collapsing margins' widths"?


Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2759 using your GitHub account
Received on Tuesday, 12 June 2018 14:27:55 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 12 June 2018 14:27:57 UTC