Re: [css21] line-height, problem?

On 27/11/2012 3:10 PM, Andrew Fedoniouk wrote:
> On Mon, Nov 26, 2012 at 5:00 PM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
>> On Mon, Nov 26, 2012 at 4:35 PM, Andrew Fedoniouk
>> <news@terrainformatica.com> wrote:
>>> Consider these two properties:
>>>
>>> 'min-height' specifies the minimal height [of an element].
>>> 'line-height' specifies the minimal height of line boxes.
>>>
>>> Seems like both define same concept - they constrain the height to a
>>> certain minimal value that
>>> computed value of height may use.
>>>
>>> By defining min-height you *cannot* make elements smaller, only larger.
>>> But by defining line-height you can make line-box smaller than its content.
>>
>> I'm confused.  You just stated completely different things.
>>
>> The line box never grows smaller than the largest line-height of the
>> box fragments on the line.  That's the same sense of "minimal" that
>> min-height gives to a box.
>>
>
> I don't understand "never grows smaller than ..." statement, something
> inside me cries about such language construct.

Well if this construct wasn't present as a default, then you could have 
overlap of glyphs. Since we can use glyphs of different fonts, the 
line-height is set by the font that has the largest line-height and the 
fonts that have a smaller line-height are vertically lowered so the 
baseline is the same across all fonts appearing in a line box.

A quick test case (assure that the viewport is wide enough so their is 
only one line):

http://css-class.com/test/css/text/linebox-line-height-fonts-001.htm

Now narrow the viewport so you have two lines and retest. You would 
hopefully had noticed that the since a new line has appeared, it is only 
that line box on the new line that changes and this is what Tab is 
saying here.

 >> The line box never grows smaller than the largest line-height of the
 >> box fragments on the line.

[snipped the remainder since you have a new message]


-- 
Alan Gresley
http://css-3d.org/
http://css-class.com/

Received on Tuesday, 27 November 2012 05:52:35 UTC