font-size-124.xht (1984B)
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 2 3 <html xmlns="http://www.w3.org/1999/xhtml"> 4 5 <head> 6 7 <title>CSS Test: inheritance of computed font-size across fonts</title> 8 9 <!-- 10 Inspired by 11 http://test.csswg.org/suites/css2.1/20110323/html4/background-position-001.htm 12 http://test.csswg.org/suites/css2.1/nightly-unstable/html4/background-position-001.htm 13 --> 14 15 <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> 16 <link rel="help" href="http://www.w3.org/TR/CSS21/syndata.html#length-units" /> 17 <link rel="help" href="http://www.w3.org/TR/CSS21/fonts.html#font-size-props" /> 18 <link rel="match" href="../reference/ref-filled-green-100px-square.xht" /> 19 20 <meta content="ahem" name="flags" /> 21 <meta content="ex unit is the 'x-height' of the relevant font. 'em' and 'ex' length values when defining 'font-size' property refer to the computed font size of the parent element." name="assert" /> 22 23 <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> 24 <style type="text/css"><![CDATA[ 25 div#overlapped-red 26 { 27 background-color: red; 28 height: 100px; 29 width: 100px; 30 } 31 32 div#grand-parent {font: 25px/1 Ahem;} 33 /* 34 To download Ahem font: 35 http://www.w3.org/Style/CSS/Test/Fonts/Ahem/ 36 */ 37 38 div#parent {font-size: 5ex;} 39 /* The Ahem font has an x-height of 0.8em. */ 40 41 div#overlapping-green 42 { 43 background-color: green; 44 bottom: 100px; 45 font-family: serif; 46 position: relative; 47 width: 100px; 48 } 49 50 /* 51 In this test, the inherited computed font-size of 52 div#overlapping-green should be 100px with a line box 53 height of 100px. 54 */ 55 ]]></style> 56 57 </head> 58 59 <body> 60 61 <p>Test passes if there is a filled green square and <strong>no red</strong>.</p> 62 63 <div id="overlapped-red"></div> 64 65 <div id="grand-parent"> 66 <div id="parent"> 67 <div id="overlapping-green"> </div> 68 </div> 69 </div> 70 71 </body> 72 </html>