empty-inline-002

Empty line box influence

WeasyPrint

This browser

Flags
ahem
Assertion
Empty inline elements still influence calculation just like elements with content.

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: Empty line box influence</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="Empty inline elements still influence calculation just like elements with content.">
10         <style type="text/css">
11             div, span
12             {
13                 font: 1in/1em Ahem;
14             }
15             #div1
16             {
17                 margin-top: 1in;
18             }
19             #div2, #div3
20             {
21                 width: 5in;
22             }
23             #div2
24             {
25                 border: 0.25in solid green;
26             }
27             span
28             {
29                 background: green;
30                 border: 0.25in solid green;
31                 margin: 1in;
32                 padding: 1in;
33             }
34             #div3
35             {
36                 border: 0.25in solid red;
37                 height: 1in;
38                 position: relative;
39                 top: -1.5in;
40                 z-index: -1;
41             }
42             #div3 div
43             {
44                 background: red;
45                 border: 0.25in solid red;
46                 height: 3in;
47                 margin: 0 1in;
48                 position: relative;
49                 top: -1.25in;
50                 width: 2in;
51             }
52         </style>
53     </head>
54     <body>
55         <p>Test passes if there is no red visible on the page.</p>
56         <div id="div1">
57             <div id="div2">
58                 <span></span>
59             </div>
60             <div id="div3">
61                 <div></div>
62             </div>
63         </div>
64     </body>
65 </html>