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

[csswg-drafts] [css-display] Block container containing only inline-level and establishing a BFC

From: Loirooriol via GitHub <sysbot+gh@w3.org>
Date: Thu, 22 Jun 2017 17:30:43 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-237918507-1498152641-sysbot+gh@w3.org>
Loirooriol has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-display] Block container containing only inline-level and establishing a BFC ==
[CSS 2.1](https://www.w3.org/TR/CSS21/visuren.html) says

> A block container box either contains only block-level boxes or establishes an inline formatting context and thus contains only inline-level boxes. [...]
> 
> Floats, absolutely positioned elements, block containers [...] that are not block boxes, and block boxes with 'overflow' other than 'visible' [...] establish new block formatting contexts for their contents.

It's not clear what should happen when a block container contains only inline-level boxes and establishes a BFC because of e.g. `overflow: hidden`. From the quotes it seems like it simultaneously establishes both an inline formatting context and a block formatting context, but this would be weird. I think what should happen is that the block container establishes a BFC, and the inline-level contents are wrapped inside an anonymous block box that establishes an inline formatting context. That is, behave like if the block container contained some block-level box.

In CSS Display this is still not clear, the [glossary](https://drafts.csswg.org/css-display-3/#block-container) says

> A block container that contains only inline-level content establishes a new inline formatting context. [...]
> 
> A block container that contains only block-level boxes establishes a new block formatting context if its parent formatting context is not a block formatting context; otherwise, when participating in a block formatting context itself, it either establishes a new block formatting context for its contents or continues the one in which it participates

This would imply that a block container which contains only inline-level content never establishes a block formatting context. This would be bad.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1553 using your GitHub account
Received on Thursday, 22 June 2017 17:30:50 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 19 October 2021 01:30:34 UTC