numbers-units-015

Height of EX

WeasyPrint

This browser

Flags
ahem, should
Assertion
In the cases where it is impossible or impractical to determine the x-height, a value of 0.5em should be 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: Height of EX</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 should">
 8         <meta name="assert" content="In the cases where it is impossible or impractical to determine the x-height, a value of 0.5em should be used.">
 9         <style type="text/css">
10             #test
11             {
12                 height: 1ex;
13                 width: 1ex;
14             }
15             #div1
16             {
17                 height: 0.5em;
18                 width: 0.5em;
19             }
20             #div2
21             {
22                 height: 0.8em;
23                 width: 0.8em;
24             }
25             div
26             {
27                 background: black;
28                 font-family: Ahem;
29                 margin-top: 2px;
30             }
31         </style>
32     </head>
33     <body>
34         <p>Test passes if any two of the boxes below are the same size.</p>
35         <div id="test"></div>
36         <div id="div1"></div>
37         <div id="div2"></div>
38     </body>
39 </html>