numbers-units-021

Root element and the 'em' unit size

WeasyPrint

This browser

Flags
96dpi, ahem
Assertion
The 'em' unit refers to the property's initial value when specified on the root element.

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: Root element and the 'em' unit size</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="96dpi ahem">
 8         <meta name="assert" content="The 'em' unit refers to the property's initial value when specified on the root element.">
 9         <style type="text/css">
10             html
11             {
12                 font-family: Ahem;
13                 font-size: 2em;
14             }
15             #div1
16             {
17                 background-color: black;
18                 height: 32px;
19                 margin-bottom: 2px;
20                 width: 32px;
21             }
22             p
23             {
24                 font-family: serif;
25                 font-size: 0.5em;
26             }
27         </style>
28     </head>
29     <body>
30         <p>Test passes if the two boxes below are the same size.</p>
31         <div id="div1"></div>
32         <div>X</div>
33     </body>
34 </html>