inline-non-replaced-height-002

Inline non-replaced elements and padding

WeasyPrint

This browser

Flags
ahem
Assertion
The padding starts at the top and bottom of the content area not the 'line-height'.

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: Inline non-replaced elements and padding</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#inline-non-replaced">
 7         <meta name="flags" content="ahem">
 8         <meta name="assert" content="The padding starts at the top and bottom of the content area not the 'line-height'.">
 9         <style type="text/css">
10             #div1
11             {
12                 margin-top: 1in;
13                 position: relative;
14             }
15             span
16             {
17                 background: blue;
18                 color: blue;
19                 font: 1in Ahem;
20                 line-height: 1.5in;
21                 padding: 0.5in 0;
22             }
23             div div
24             {
25                 background: orange;
26                 height: 2in;
27                 left: 1in;
28                 position: absolute;
29                 top: -0.25in;
30                 width: 1in;
31             }
32         </style>
33     </head>
34     <body>
35         <p>Test passes if the blue and orange boxes below are the same height.</p>
36         <div id="div1">
37             <span>X</span>
38             <div></div>
39         </div>
40     </body>
41 </html>