W3C home > Mailing lists > Public > www-style@w3.org > February 2012

[CSS21] section 10.8.1: when line-height is equal to or less than content area (font-size)

From: Gérard Talbot <www-style@gtalbot.org>
Date: Wed, 22 Feb 2012 21:44:36 -0500
Message-ID: <f6ec0ee9d6b9cf4767b18c09dfd4c41c.squirrel@ed-sh-cp3.entirelydigital.com>
To: "W3C www-style mailing list" <www-style@w3.org>

Although margins, borders, and padding of non-replaced elements do not
enter into the line box calculation, they are still rendered around inline
boxes. This means that if the height specified by 'line-height' is less
than the content height of contained boxes, backgrounds and colors of
padding and borders may "bleed" into adjoining line boxes. User agents
should render the boxes in document order. This will cause the borders on
subsequent lines to paint over the borders and text of previous lines.

The above is not thorough and, IMO, is not precise. The "may" of "may
bleed" seems inappropriate, incorrect, definitely hesitant when it should
not. I do not understand the recourse of the "may" in the sentence.

I believe it should be saying instead that:

if the height specified by 'line-height' is *equal to* the content height
of contained boxes, then backgrounds and colors of padding and borders, if
any, *will* "bleed" into adjoining line boxes.
If the height specified by 'line-height' is *less than* the content height
of contained boxes, then background-color of content area *will* "bleed"
into adjoining line boxes.

4 tests support such editorial changes:




(using normal serif font; we could have created the same test with the
Ahem font).

Glyphs in a smaller line box bleed out of their line box and they overlap
*over* the previous line box (they overlap *under* following line box).
None of this is actually written in the current spec.

regards, Gérard
CSS 2.1 Test suite RC6, March 23rd 2011

Contributions to CSS 2.1 test suite

Web authors' contributions to CSS 2.1 test suite
Received on Thursday, 23 February 2012 02:45:09 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:12 UTC