W3C home > Mailing lists > Public > www-style@w3.org > December 2014

Re: Option so line-height only affects height between lines

From: Alan Stearns <stearns@adobe.com>
Date: Mon, 8 Dec 2014 22:15:19 +0000
To: Ben Sciascia <ben.sciascia@sciascia.co.nz>, "www-style@w3.org" <www-style@w3.org>
Message-ID: <921F78D3-AC83-4C80-BB2A-1019DD894F45@adobe.com>
On 12/1/14, 7:49 PM, "Ben Sciascia" <ben.sciascia@sciascia.co.nz> wrote:

>Line-height in CSS not only affects the height between lines of text, it 
>also alters the space above and below elements.
>This creates a situation similar to the old box model when padding also 
>affected width - changing line-height in CSS can require us to also alter 
>top and bottom margins or padding.
>Overall, this suggestion is about creating an additional line-height 
>property that forces line-height to only affect the height between lines 
>and not the space before and after elements.

I think it might be useful to have a leading-model property that allowed 
you to change how line-height works. But it might also be more complicated 
than it’s worth. In my experience, sticking with a single leading model is 
the only way to reasonably lay out lines. The boundaries between leading 
models almost never give you the results you want.

There are a few different ways to deal with leading. I’m assuming you’re 
looking for one of these:

1. line-height sets the baseline-to-baseline distance 
  (font-size of 16px and line-height of 20px adds 4px below the descent)

2. line-height only sets the space between lines
  (font-size of 16px and line-height of 4px adds 4px below the descent)

I think the first would make the most sense as a leading-model addition, 
as it’s closest to what CSS does now. Instead of dividing the difference 
and adding to both top and bottom, it just adds the whole difference to 
the bottom.


Received on Monday, 8 December 2014 22:15:53 UTC

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