floats-016.xht (1625B)
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: Floated elements stacked with blocks and inline elements</title> 5 <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> 6 <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> 7 <meta name="assert" content="Floated elements are rendered in front of non-positioned in-flow blocks but behind in-flow inline boxes when a normal flow box is next to a floated element with negative margins." /> 8 <style type="text/css"> 9 #container 10 { 11 margin: 0.5in; 12 } 13 #inline 14 { 15 background: yellow; 16 margin-left: -0.5in; 17 } 18 #float, #block 19 { 20 height: 1in; 21 width: 1in; 22 } 23 #float 24 { 25 background: orange; 26 float: left; 27 } 28 #block 29 { 30 background: blue; 31 margin: -0.25in; 32 } 33 </style> 34 </head> 35 <body> 36 <p>Test passes if the boxes are partially stacked on top of each other, and they are stacked in the following order from bottom to top: blue, orange, yellow.</p> 37 <div id="container"> 38 <span id="inline">Filler Text</span> 39 <div id="float">Filler Text</div> 40 <div id="block">Filler Text</div> 41 </div> 42 </body> 43 </html>