Re: [CSS] Lengths relative to the line height

On 26 Sep 2003 at 15:16, Joachim Noreiko wrote:
> 
>  --- Stanimir Stamenkov <stanio@yahoo.com> wrote: > 
> > Would it be good if there's a unit just like 'em'
> > (where you specify 
> > a length relative to the parent element's font size)
> > to specify 
> > lengths relative to the parent element's line
> > height?
> 
> isn't that
> "ex: the 'x-height' of the relevant font"
> ?

No not really. The x-height is a property of the current font (and 
could theoretically differ a lot depending on for instance font-
family), which typically is around half of an em, and is really 
independent of the current line-height. The only connection i see is 
that the line-height is typically (like in the suggested default) 
defined in em:s, which are also a property of the current font.

I'm not sure the suggestion is a good idea since i think it may be 
difficult to use with some line stacking strategies of CSS3. This is 
a rather complex area of CSS, and without quite specific and 
important use cases for such a unit i don't think it should be 
considered. 

Is the computed end result of the unit only dependant on the line-
height property or are you considering values relative to the actual 
calculated line-box height? In the former case you should probably 
use explict declarations instead since you may need to consider 
possible replaced element and in the second i think the potential for 
circular dependencies etc is far to large. How would you know how 
many lines you needed in the float example? Unless you use nowrap or 
something you couldn't really know since that is UA and font 
dependant i think.

 /Staffan

Received on Saturday, 27 September 2003 05:02:23 UTC