W3C home > Mailing lists > Public > www-style@w3.org > March 2011

Re: line-height limitations

From: Brad Kemper <brad.kemper@gmail.com>
Date: Fri, 18 Mar 2011 15:38:18 -0700
Message-Id: <66CB4D9F-8EB8-4FF0-A319-D526165C4B84@gmail.com>
Cc: David Hyatt <hyatt@apple.com>, David Woolley <forums@david-woolley.me.uk>, www-style CSS <www-style@w3.org>
To: "L. David Baron" <dbaron@dbaron.org>
On Mar 18, 2011, at 3:20 PM, "L. David Baron" <dbaron@dbaron.org> wrote:

> On Friday 2011-03-18 15:08 -0700, Brad Kemper wrote:
>> Actually, what I meant is to change the UA stylesheet, so if, for example, it currently has this:
>> 
>> p { line-height:1.2; }
>> 
>> then instead you change it to this:
>> 
>> p { line-height:1.2em; }
>> 
>> Does this not fix the problem with little or no negative repercussions?
> 
> This causes multiple problems:
> 
> * It means that <p><span style="font-size:2em">text</span></p> has
>   overlapping text.

I'm not sure what you mean it overlaps with, but in my testing with webkit, I didn't see any problem with that. The larger font span inherited the line-height length measurement of the P, but the line box grew taller (apparently) to push the text downward, preventing any overlap with previous lines or with the top of the content box. The only thing that did any overlapping was descenders with the next lines, which is the wanted result. 


> 
> * It means that <p>text <span style="font-size:0.7em">text</span>
>   text</p> has *wider* lines on the lines with the small text
>   because the half-leading for the small text is larger and thus
>   extends lower.
> 
> -David
> 
> -- 
> L. David Baron                                 http://dbaron.org/
> Mozilla Corporation                       http://www.mozilla.com/
Received on Friday, 18 March 2011 22:38:59 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:38 GMT