W3C home > Mailing lists > Public > www-style@w3.org > January 2008

Re: Line layout in browsers

From: David Hyatt <hyatt@apple.com>
Date: Mon, 21 Jan 2008 14:50:37 -0600
To: "Eric A. Meyer" <eric@meyerweb.com>
Cc: CSS <www-style@w3.org>
Message-id: <24E54C87-15AF-4CC8-9977-2A61B7AC4892@apple.com>

On Jan 21, 2008, at 2:38 PM, David Hyatt wrote:

> On Jan 21, 2008, at 2:25 PM, Eric A. Meyer wrote:
>> At 5:18 PM -0800 1/17/08, Alex Mogilevsky wrote:
>>>>    * Conversely, the borders overlap in Explorer and Firefox at  
>>>> '1',
>>>> but get close to touching at '1.2'.  Which again seems backwards.
>>> '1' is normally less than default line height defined by font. So  
>>> span borders (which are drawn around actual character boxes) will  
>>> overlap. What is unexpected there?
>>  Wait, what?  The last I checked, the height of a line is based on  
>> the computed 'font-size' of an element.

What Alex is saying is that the default value of "normal" for line- 
height results in the browser using the line height that is built into  
the font itself. That value, if viewed as a multiple of the font size,  
is almost always > 1 (and usually closer to 1.2).  Picking '1' as your  
explicit line-height is typically going to result in lines that are  
pretty close together, since you've effectively eliminated the gaps  
between lines (making it possible for a character with  a large  
descent to touch a character on the next line with a large ascent).   
Therefore building additional height into any spans on the line  
through the use of border/padding is going to pretty much guarantee an  
overlap of those boxes.

Received on Monday, 21 January 2008 20:50:59 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:33 UTC