floats-024.xht (1361B)
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: Left float with earlier floated siblings</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 <link rel="match" href="floats-024-ref.xht" /> 8 9 <meta name="assert" content="Left floated box is to right of earlier floated box or below the earlier floated element's bottom edge." /> 10 <style type="text/css"> 11 div 12 { 13 border-top: solid 5px black; 14 width: 300px; 15 } 16 span 17 { 18 float: left; 19 height: 1in; 20 width: 1in; 21 } 22 #span1 23 { 24 background-color: orange; 25 } 26 #span2 27 { 28 background-color: blue; 29 } 30 </style> 31 </head> 32 <body> 33 <p>Test passes if the orange square is to the left of the blue square and the top edges of both squares touch the black line.</p> 34 <div> 35 <span id="span1"></span> 36 <span id="span2"></span> 37 </div> 38 </body> 39 </html>