lh-unit-002.html (812B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Values and Units Test: using lh in font-size</title> 4 <link rel="author" title="Florian Rivoal" href="https://florian.rivoal.net/"> 5 <link rel="help" href="https://drafts.csswg.org/css-values-4/#font-relative-lengths"> 6 <link rel="match" href="../reference/ref-filled-green-100px-square.xht"> 7 <meta name="assert" content="The lh unit resolves against the parent when used in the font-size property."> 8 <style> 9 div { 10 width: 100px; 11 height: 100px; 12 background: red; 13 line-height: 50px; 14 } 15 aside { 16 background: green; 17 height: 1em; 18 line-height: 42px; /* number doesn't matter, as long as it's neither 50 nor 100*/ 19 font-size: 2lh; 20 } 21 22 </style> 23 24 <p>Test passes if there is a filled green square and <strong>no red</strong>.</p> 25 26 <div><aside> </aside></div>