overflow-006.xht (1161B)
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 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>