numbers-units-007

Em sizes

WeasyPrint

This browser

Flags
ahem
Assertion
The 'em' unit is equal to the computed value of the 'font-size' property (default) of the element on which it is used.

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: Em sizes</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="The 'em' unit is equal to the computed value of the 'font-size' property (default) of the element on which it is used.">
 9         <style type="text/css">
10             #test
11             {
12                 background: black;
13                 height: 1em;
14                 width: 1em;
15             }
16             div
17             {
18                 font-family: Ahem;
19                 margin-top: 10px;
20             }
21         </style>
22     </head>
23     <body>
24         <p>Test passes if the two boxes below are the same size.</p>
25         <div id="div1">
26             <div id="test"></div>
27             <div>X</div>
28         </div>
29     </body>
30 </html>