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

Re: [csswg-drafts] [css-2] overflow: hidden cause extra space

From: Ilya Streltsyn via GitHub <sysbot+gh@w3.org>
Date: Thu, 28 Jun 2018 15:50:50 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-401082424-1530201049-sysbot+gh@w3.org>
Actually, the behavior of the `inline-block` elements regarding the baseline position is described in the last paragraph of Section 10.8.1 of CSS 2.x (vertical-align propery definition):

> The baseline of an 'inline-block' is the baseline of its last line box in the normal flow, unless it has either no in-flow line boxes or if its 'overflow' property has a computed value other than 'visible', in which case the baseline is the bottom margin edge.

If the baseline of the element is the bottom margin edge and it has `vertical-align: baseline` (as by default), it has space below the baseline reserved for the descenders of the font characters (the same thing occurs with the `<img>` elements by default). I see this behavior in all major browsers. In general, all `inline-*` elements are expected to be placed into the line of text and be somehow aligned with the neighbor text, so using these display values in other context is already somehow "hacky". In the SO example, the better solution would be to use `display: block` for the inner element.

-- 
GitHub Notification of comment by SelenIT
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2838#issuecomment-401082424 using your GitHub account
Received on Thursday, 28 June 2018 15:50:55 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 28 June 2018 15:50:59 UTC