box-generation-002

Block-level elements generate principal block boxes with inline boxes

WeasyPrint

This browser

Assertion
Inline boxes can reside within a principal block box established by a block-level element; block boxes are outside of the principal block 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: Block-level elements generate principal block boxes with inline boxes</title>
 5         <link rel="author" title="Microsoft" href="http://www.microsoft.com/">
 6         <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#block-boxes">
 7         <meta name="flags" content="">
 8         <meta name="assert" content="Inline boxes can reside within a principal block box established by a block-level element; block boxes are outside of the principal block box.">
 9         <style type="text/css">
10             span
11             {
12                 background: blue;
13                 width: 1in;
14             }
15             #div1
16             {
17                 background: orange;
18                 float: left;
19                 width: 0.5in;
20             }
21             #div2
22             {
23                 background: yellow;
24             }
25         </style>
26     </head>
27     <body>
28         <p>Test passes if the orange box is to the left of the blue box and both boxes are above the yellow box.</p>
29         <div>
30             <span>Inline box</span>
31             <div id="div1">Float</div>
32             <div id="div2">Block box</div>
33         </div>
34     </body>
35 </html>