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

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