numbers-units-018

Specifying em/ex on the root element

WeasyPrint

This browser

Flags
ahem
Assertion
Units 'em' and 'ex' refer to the initial value of the property when specified on the root element of a document.

Source

 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 2 <html>
 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         <meta name="flags" content="ahem">
 8         <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.">
 9         <style type="text/css">
10             html
11             {
12                 border: 1px solid;
13                 font: 20px/1 Ahem;
14                 margin-left: 20em;
15                 margin-top: 20ex;
16             }
17             div
18             {
19                 position: absolute;
20             }
21             #div1
22             {
23                 background: orange;
24                 height: 20px;
25                 left: 0;
26                 top: 320px;
27                 width: 400px;
28             }
29             #div2
30             {
31                 background: blue;
32                 height: 320px;
33                 left: 400px;
34                 top: 0;
35                 width: 20px;
36             }
37             p
38             {
39                 font: 16px serif;
40             }
41         </style>
42     </head>
43     <body>
44         <p>Test passes if the black box containing this text is to the right of the orange box and below the blue box.</p>
45         <div id="div1"></div>
46         <div id="div2"></div>
47     </body>
48 </html>