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

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.
>
>…
>
>CONCLUSION:
>
>
>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.

Thanks,

Alan

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