floats-wrap-bfc-005.xht (2195B)
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en-US"><head> 2 <title>CSS Test: Test for flow around floats</title> 3 <link rel="author" title="L. David Baron" href="https://dbaron.org/" /> 4 <link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" /> 5 <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> 6 <link rel="match" href="floats-wrap-bfc-005-ref.xht"/> 7 <meta name="assert" content="The border box of a table, a block-level replaced element, or an element in the normal flow that establishes a new block formatting context (such as an element with 'overflow' other than 'visible') must not overlap any floats in the same block formatting context as the element itself." /> 8 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 9 <meta http-equiv="Content-Style-Type" content="text/css" /> 10 <style type="text/css"> 11 12 body { font-size: 10px; } 13 14 table { margin: 0; border-spacing: 0; } 15 td, th { padding: 0; vertical-align: top; } 16 17 </style> 18 </head> 19 <body> 20 21 <table width="300" style="background: aqua"><tbody><tr><td> 22 <div style="float:left; background:blue; width: 200px; height: 20px"></div> 23 <table width="50%" style="background: yellow" height="20"><tbody><tr><td>50%</td></tr></tbody></table> 24 </td></tr></tbody></table> 25 26 <table width="300" style="background: aqua"><tbody><tr><td> 27 <div style="float:right; background:blue; width: 200px; height: 20px"></div> 28 <table width="50%" style="background: yellow" height="20"><tbody><tr><td>50%</td></tr></tbody></table> 29 </td></tr></tbody></table> 30 31 <table width="300" style="background: aqua"><tbody><tr><td> 32 <div style="float:left; background:blue; width: 200px; height: 20px"></div> 33 <div style="overflow:hidden; background: yellow; width: 50%; height: 20px;">50%</div> 34 </td></tr></tbody></table> 35 36 <table width="300" style="background: aqua"><tbody><tr><td> 37 <div style="float:right; background:blue; width: 200px; height: 20px"></div> 38 <div style="overflow:hidden; background: yellow; width: 50%; height: 20px;">50%</div> 39 </td></tr></tbody></table> 40 41 42 43 </body></html>