floats-040.xht (1641B)
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: Floats inline-block level element margins</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-03 --> 7 <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" /> 8 <link rel="match" href="floats-038-ref.xht" /> 9 10 <meta name="assert" content="The border box of a inline-block level element cannot overlap any floats in the same block formatting context as the element itself." /> 11 <style type="text/css"> 12 #div1 13 { 14 width: 2in; 15 height: 2in; 16 border: black solid 5px; 17 } 18 div div 19 { 20 height: 0.5in; 21 width: 0.5in; 22 } 23 #div2 24 { 25 background: blue; 26 float: left; 27 } 28 #div3 29 { 30 background: orange; 31 display: inline-block; 32 border: white solid 10px; 33 } 34 </style> 35 </head> 36 <body> 37 <p>Test passes if the orange square is to the right of the blue square, space needs to also separate the orange square from other squares.</p> 38 <div id="div1"> 39 <div id="div2"></div> 40 <div id="div3"></div> 41 </div> 42 </body> 43 </html>