- From: Alan Gresley <alan@css-class.com>
- Date: Sun, 20 Oct 2013 03:36:42 +1100
- To: Glenn Adams <glenn@skynav.com>, Gérard Talbot <www-style@gtalbot.org>
- CC: John Hudson <tiro@tiro.com>, W3C Style <www-style@w3.org>
On 19/10/2013 11:36 AM, Glenn Adams wrote:
> On Fri, Oct 18, 2013 at 5:31 PM, Gérard Talbot <www-style@gtalbot.org>wrote:
>
>> Le 2013-10-18 13:28, Glenn Adams a écrit :
>>
[snipped]
>>> What I am observing, however, is that font size appears to be interpreted
>>> on a per-line basis in order to create a per-line value for line height.
>>>
>>
>> Yes. That's how it should be too. In a multi-line block element, each line
>> box can have its own distinct height.
>
>
> Unfortunately you are using "line height" in two ways. I am referring to *the
> property whose name is 'line-height'*. You are referring to the *height of
> a line box*. I am talking about only the former, and not about the latter.
There is no former and later. If line-height has a value other than
normal like <number> | <length> | <percentage>, then the line box will
be the height of the declared line-height value.
A test case.
<style type="text/css">
.element { font-size: 100px;}
.block { background: skyblue; height: 50px; }
.block+.block { background: yellowgreen; }
</style>
<div class="element" style="line-height: 0px;">
<div class="block"></div>
XpÉx
<div class="block"></div>
</div>
<div class="element" style="line-height: 0em;">
<div class="block"></div>
XpÉx
<div class="block"></div>
</div>
<div class="element" style="line-height: 0pt;">
<div class="block"></div>
XpÉx
<div class="block"></div>
</div>
<div class="element" style="line-height: 0;">
<div class="block"></div>
XpÉx
<div class="block"></div>
</div>
<div class="element" style="line-height: 0%;">
<div class="block"></div>
XpÉx
<div class="block"></div>
</div>
> I am trying to resolve what it means to *determine a used value for the
> property named 'line-height'* when its computed value is 'normal'. The
> result of this process serves as an input parameter for the subsequent
> process of *determining the height of a line box*.
If you have line-height: normal, it's much like having height: auto. You
don't need to have line-height: normal since it's the initial value
already and if the inherited value from an ancestor is a value that is
not normal, then declaring normal will return it to the initial value.
Much like auto is the initial value for height.
A test case.
<style type="text/css">
body { font-size: 100px; }
.block { background: skyblue; height: 50px; }
.block+.block { background: yellowgreen; }
</style>
<div style="line-height: 0">
XpÉx
<div class="element" style="line-height: normal">
<div class="block"></div>
XpÉx
<div class="block"></div>
</div>
</div>
Alan
--
Alan Gresley
http://css-3d.org/
http://css-class.com/
Received on Saturday, 19 October 2013 16:37:13 UTC