line-box-height-001

Height for inline elements when 'line-height' is smaller than 'height'

WeasyPrint

This browser

Flags
ahem
Assertion
The 'line-height' property sets the initial height but that height is increased if the content height is larger.

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 for inline elements when 'line-height' is smaller than 'height'</title>
 5         <link rel="author" title="Microsoft" href="http://www.microsoft.com/">
 6         <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#propdef-line-height">
 7         <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#leading">
 8         <meta name="flags" content="ahem">
 9         <meta name="assert" content="The 'line-height' property sets the initial height but that height is increased if the content height is larger.">
10         <style type="text/css">
11             #div1
12             {
13                 color: blue;
14                 font: 1in/1em Ahem;
15                 position: relative;
16             }
17             span
18             {
19                 line-height: 0;
20             }
21             #div2
22             {
23                 background: orange;
24                 height: 2in;
25                 left: 1in;
26                 position: absolute;
27                 top: 0;
28                 width: 1in;
29             }
30         </style>
31     </head>
32     <body>
33         <p>Test passes if the blue and orange boxes below are the same height.</p>
34         <div id="div1">
35             <div>X</div>
36             <span>X</span>
37             <div id="div2"></div>
38         </div>
39     </body>
40 </html>