floats-027.xht (1521B)
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: Margin affects right floated 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 <link rel="match" href="floats-027-ref.xht" /> 8 9 <meta name="assert" content="Right outer edge of left-floating box cannot be to the right of the left outer edge of any right-floating box that is to the right of it." /> 10 <style type="text/css"> 11 div 12 { 13 border: solid 5px black; 14 height: 2in; 15 width: 2in; 16 } 17 span 18 { 19 height: 1in; 20 width: 1in; 21 } 22 #span1 23 { 24 background: blue; 25 float: right; 26 margin-left: 10px; 27 } 28 #span2 29 { 30 background-color: orange; 31 float: left; 32 margin-right: 10px; 33 } 34 </style> 35 </head> 36 <body> 37 <p>Test passes if the blue square is aligned on the right side of the hollow black square and is above the orange, left aligned, square.</p> 38 <div> 39 <span id="span1"></span> 40 <span id="span2"></span> 41 </div> 42 </body> 43 </html>