clear-float-006.xht (1561B)
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: Clear set to 'both' with earlier floated boxes</title> 5 <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> 6 <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-07-02 --> 7 <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#flow-control" /> 8 <link rel="match" href="clear-float-006-ref.xht" /> 9 10 <meta name="assert" content="Boxes with 'clear: both' need to clear earlier floated boxes." /> 11 <style type="text/css"> 12 div 13 { 14 width: 3in; 15 } 16 span 17 { 18 height: 1in; 19 width: 1in; 20 } 21 #span1, #span2 22 { 23 background-color: orange; 24 } 25 #span1 26 { 27 float: right; 28 } 29 #span2, #span3 30 { 31 float: left; 32 } 33 #span3 34 { 35 background: blue; 36 clear: both; 37 } 38 </style> 39 </head> 40 <body> 41 <p>Test passes if the blue box is below the orange boxes.</p> 42 <div> 43 <span id="span1"></span> 44 <span id="span2"></span> 45 <span id="span3"></span> 46 </div> 47 </body> 48 </html>