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

Re: [css3-values] Which font to use for the ex unit?

From: Simon Sapin <simon.sapin@kozea.fr>
Date: Thu, 17 Jan 2013 21:17:59 +0100
Message-ID: <50F85C77.6030704@kozea.fr>
To: www-style@gtalbot.org
CC: "CSS WWW Style (www-style@w3.org)" <www-style@w3.org>
Le 17/01/2013 20:38, "Gérard Talbot" a écrit :
> CSS 2.1, section 4.3.2 Lengths states
>
> "
> ex: the 'x-height' of the relevant font
> (...)
> The 'ex' unit is defined by the element's first available font.

Yes, this is the key sentence.


> The
> exception is when 'ex' occurs in the value of the 'font-size' property, in
> which case it refers to the 'ex' of the parent element.
> "
> http://www.w3.org/TR/CSS21/syndata.html#length-units


css3-values already says …

"""
The exception is when [font-relative lengths] occur in the value of the 
‘font-size’ property itself, in which case they refer to the computed 
font metrics of the parent element (or the computed font metrics 
corresponding to the initial values of the ‘font’ property, if the 
element has no parent).
"""

which I think is the same. (ex of the parent vs. x-height of the first 
font of the parent.)


> This chunk of text is most likely what is missing in
> CSS 3 Values and Units, section 5.1.1. Font-relative lengths: the ‘em’,
> ‘ex’, ‘ch’, ‘rem’ units
> http://www.w3.org/TR/css3-values/#ex-unit

Yes, that would be an adequate fix.

-- 
Simon Sapin
Received on Thursday, 17 January 2013 20:18:23 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:04 GMT