floats-040

Floats inline-block level element margins

WeasyPrint

This browser

Assertion
The border box of a inline-block level element cannot overlap any floats in the same block formatting context as the element itself.

Source

 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 2 <html>
 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="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats">
 7         <meta name="flags" content="">
 8         <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.">
 9         <style type="text/css">
10             #div1
11             {
12                 width: 2in;
13                 height: 2in;
14                 border: black solid 5px;
15             }
16             div div
17             {
18                 height: 0.5in;
19                 width: 0.5in;
20             }
21             #div2
22             {
23                 background: blue;
24                 float: left;
25             }
26             #div3
27             {
28                 background: orange;
29                 display: inline-block;
30                 border: 0.1in solid white;
31             }
32         </style>
33     </head>
34     <body>
35         <p>Test passes if the orange box is to the right of the blue box, space needs to also separate the orange box from other boxes.</p>
36         <div id="div1">
37             <div id="div2"></div>
38             <div id="div3"></div>
39         </div>
40     </body>
41 </html>