stack-floats-004.xht (1671B)
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" lang="en"> 3 <head> 4 <title>CSS Test: Stacking order: Floats and Blocks in Inlines</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/box/float/stacking/004.html" type="text/html"/> 7 <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#layers" /> 8 <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> 9 <link rel="match" href="stack-floats-001-ref.xht" /> 10 11 <meta content="ahem" name="flags" /> 12 13 <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> 14 <style type="text/css"> 15 /* outer block */ 16 .container { width: 5em; height: 5em; border: solid; font: 20px/1 Ahem; background: red; display: block; } 17 .inner { display: block; } 18 19 /* top and bottom */ 20 .float { width: 5em; height: 3em; margin: -5em 0 0 0; padding: 1em 0; background: red; float: left; } 21 .inner .inline { color: lime; display: inline; } 22 23 /* middle */ 24 .float .block { height: 3em; margin: 0; background: lime; display: block; } 25 .inner .block { height: 3em; margin: 0; background: red; display: block; } 26 27 </style> 28 </head> 29 <body> 30 <p>Test passes if there is one single filled bright green square (with a black border) and no red.</p> 31 32 <div class="container"> 33 <div class="inner"> 34 <div class="inline">XXXXX</div> 35 <div class="block"></div> 36 <div class="inline">XXXXX</div> 37 </div> 38 <div class="float"> 39 <div class="block"></div> 40 </div> 41 </div> 42 43 </body> 44 </html>