block-formatting-context-height-001

Block formatting context auto height with floats and bottom margins

WeasyPrint

This browser

Assertion
The auto height of a block formatting context element is computed by accounting for bottom-margins of floated content which would otherwise be below the bottom edge of that element.

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 formatting context auto height with floats and bottom margins</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#root-height">
 7         <meta name="flags" content="">
 8         <meta name="assert" content="The auto height of a block formatting context element is computed by accounting for bottom-margins of floated content which would otherwise be below the bottom edge of that element.">
 9         <style type="text/css">
10             #container
11             {
12                 width: 100px;
13                 height: auto;
14                 background: black;
15                 position: absolute;
16             }
17             #float
18             {
19                 float: left;
20                 margin-bottom: 50px;
21                 height: 50px;
22                 width: 100%; 
23             }
24         </style>
25     </head>
26     <body>
27         <p>Test passes if there is a square below.</p>
28         <div id="container">
29             <div id="float"></div>
30         </div>
31     </body>
32 </html>