inline-block-non-replaced-height-002

Inline-block non-replaced elements' margin box is used for the height of the line box

WeasyPrint

This browser

Assertion
Inline-block non-replaced elements use the margin box for sizing the height of the line box.

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-block non-replaced elements' margin box is used for the height of the line box</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#block-root-margin">
 7         <meta name="flags" content="">
 8         <meta name="assert" content="Inline-block non-replaced elements use the margin box for sizing the height of the line box.">
 9         <style type="text/css">
10             #div1
11             {
12                 line-height: 0;
13                 position: relative;
14             }
15             #div2
16             {
17                 background: blue;
18             }
19             #div2 div
20             {
21                 display: inline-block;
22                 height: 0;
23                 margin: 0.5in 0;
24             }
25             div div
26             {
27                 width: 1in;
28             }
29             #div3
30             {
31                 background: orange;
32                 left: 1in;
33                 height: 1in;
34                 position: absolute;
35                 top: 0;
36             }
37         </style>
38     </head>
39     <body>
40         <p>Test passes if the blue and orange boxes below are the same height.</p>
41         <div id="div1">
42             <div id="div2">
43                 <div></div>
44             </div>
45             <div id="div3"></div>
46         </div>
47     </body>
48 </html>