numbers-units-018.xht (1739B)
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <title>CSS Test: Specifying em/ex on the root element</title> 5 <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> 6 <link rel="help" href="http://www.w3.org/TR/CSS21/syndata.html#length-units" /> 7 <link rel="match" href="numbers-units-018-ref.xht"/> 8 <meta name="flags" content="ahem" /> 9 <meta name="assert" content="Units 'em' and 'ex' refer to the initial value of the property when specified on the root element of a document." /> 10 <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> 11 <style type="text/css"> 12 html 13 { 14 border: 1px solid; 15 font: 20px/1 Ahem; 16 margin-left: 20em; 17 margin-top: 20ex; 18 } 19 div 20 { 21 position: absolute; 22 } 23 #div1 24 { 25 background: orange; 26 height: 20px; 27 left: 0; 28 top: 320px; 29 width: 400px; 30 } 31 #div2 32 { 33 background: blue; 34 height: 320px; 35 left: 400px; 36 top: 0; 37 width: 20px; 38 } 39 p 40 { 41 font: 16px serif; 42 } 43 </style> 44 </head> 45 <body> 46 <p>Test passes if the black box containing this text is to the right of the orange box and below the blue box.</p> 47 <div id="div1"></div> 48 <div id="div2"></div> 49 </body> 50 </html>