overflow-006

Floats and overflow

WeasyPrint

This browser

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: Floats and overflow</title>
 5   <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch">
 6   <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/overflow/box/002.html" type="text/html">
 7   <link rel="help" href="http://www.w3.org/TR/CSS21/visufx.html#overflow">
 8   <style type="text/css">
 9    p { color: green; }
10    .container { border: solid white; position: relative; }
11    .overflow { overflow: auto; color: yellow; background: red; height: 0; }
12    .float { float: left; background: red; color: yellow; width: 10em; }
13    .pass { background: white; color: black; width: 10em; }
14    .fail { background: black; position: absolute; top: 1em; }
15   </style>
16  </head>
17  <body>
18   <p>It should say "PASS" below:</p>
19   <div class="container">
20    <div class="fail"> XXXX </div>
21    <div class="overflow"> <div class="float"> FAIL </div> FAIL </div>
22    <div class="pass"> PASS </div> <!-- the float should be contained inside the overflow block -->
23   </div>
24  </body>
25 </html>