@@ -884,6 +884,10 @@ Relative lengths</h3>
884
884
as represented by the “水” (CJK water ideograph, U+6C34) glyph
885
885
<tr><td> ''rem''
886
886
<td> font size of the root element
887
+ <tr><td> ''lh''
888
+ <td> line height of the element
889
+ <tr><td> ''rlh''
890
+ <td> line height of the root element
887
891
<tr><td> ''vw''
888
892
<td> 1% of viewport's width
889
893
<tr><td> ''vh''
@@ -913,14 +917,19 @@ Relative lengths</h3>
913
917
-->
914
918
915
919
<h4 id="font-relative-lengths">
916
- Font-relative lengths: the ''em'', ''ex'', ''ch'', ''ic'', ''rem'' units</h4>
920
+ Font-relative lengths: the ''em'', ''ex'', ''ch'', ''ic'', ''rem'', ''lh'', ''rlh'' units</h4>
917
921
918
- Aside from ''rem'' (which refers to the font-size of the root element),
922
+ Aside from ''rem'' (which refers to the font-size of the root element)
923
+ and ''rlh'' (which refers to the line-height of the root element),
919
924
the <dfn export id="font-relative-length">font-relative lengths</dfn> refer to the font metrics of the element on which they are used.
920
925
The exception is when they occur in the value of the 'font-size' property itself,
921
926
in which case they refer to the computed font metrics of the parent element
922
927
(or the computed font metrics corresponding to the initial values of the 'font' property,
923
928
if the element has no parent).
929
+ In addition, if the ''lh'' unit is used in the value of the 'line-height' property,
930
+ it also refer to the computed metrics on the parent element
931
+ (or the computed metrics corresponding to the initial values of the 'font' and 'line-height' properties,
932
+ if the element has no parent).
924
933
925
934
<dl export dfn-type=value dfn-for="<length> ">
926
935
<dt> <dfn id="em" lt="em">em unit</dfn>
@@ -996,6 +1005,24 @@ Font-relative lengths: the ''em'', ''ex'', ''ch'', ''ic'', ''rem'' units</h4>
996
1005
Equal to the computed value of 'font-size' on the root element.
997
1006
When specified on the 'font-size' property of the root element,
998
1007
the ''rem'' units refer to the property's <em> initial value</em> .
1008
+ <dt> <dfn id="lh" lt="lh">lh unit</dfn>
1009
+ <dd>
1010
+ Equal to the computed value of the 'line-height' property of the element on which it is used,
1011
+ converted to an absolute length.
1012
+
1013
+ <dt> <dfn id="rlh" lt="rlh">rlh unit</dfn>
1014
+ <dd>
1015
+ Equal to the computed value of 'line-height' property on the root element,
1016
+ converted to an absolute length.
1017
+ When specified on the 'font-size' or 'line-height' properties of the root element,
1018
+ the ''rlh'' units refer to the properties' <em> initial value</em> .
1019
+
1020
+ Note: setting the 'height' of an element using either the ''lh'' or the ''rlh'' units
1021
+ does not enable authors to control the actual number of lines in that element.
1022
+ These units only enable length calculations based on the theoretical size of an ideal empty line;
1023
+ the size of actual lines boxes may differ based on their content.
1024
+ In cases where an author wants to limit the number of actual lines in an element,
1025
+ the 'max-lines' property shall be used instead.
999
1026
</dl>
1000
1027
1001
1028
<!--
@@ -2273,7 +2300,7 @@ Changes</h2>
2273
2300
Changes since <a href="http://www.w3.org/TR/css-values-3/">Level 3</a> :
2274
2301
2275
2302
<ul>
2276
- <li> Added the ''vi'' , ''vb'' , and ''ic '' units.
2303
+ <li> Added the ''vi'' , ''vb'' , ''ic'' , ''lh' and ''rlh '' units.
2277
2304
</ul>
2278
2305
2279
2306
<h2 class="no-num" id="sec-pri">
0 commit comments