box-generation-001

Block-level elements generate principal block boxes with block boxes

WeasyPrint

This browser

Assertion
Block boxes can reside within a principal block box established by a block-level element; inline 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 block 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="Block boxes can reside within a principal block box established by a block-level element; inline boxes are outside of the principal block box.">
 9         <style type="text/css">
10             div div
11             {
12                 background: blue;
13                 width: 1in;
14             }
15             #span1
16             {
17                 background: orange;
18                 width: 1in;
19             }
20             #span2
21             {
22                 background: yellow;
23                 float: left;
24                 width: 0.5in;
25             }
26         </style>
27     </head>
28     <body>
29         <p>Test passes if the orange box is below the blue box and the yellow box is directly left of the orange box.</p>
30         <div id="div1">
31             <div>Block box</div>
32             <span id="span1">Inline box</span>
33             <span id="span2">Float</span>
34         </div>
35     </body>
36 </html>