floats-038

Floats and table margins

WeasyPrint

This browser

Assertion
The border box of a table cannot overlap any floats in the same block formatting context as the elements 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 and table 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 table cannot overlap any floats in the same block formatting context as the elements itself.">
 9         <style type="text/css">
10             #div1
11             {
12                 border: black solid 5px;
13                 height: 2in;
14                 width: 2in;
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             #table
27             {
28                 background: orange;
29                 display: table;
30                 border: 0.1in solid white;
31             }
32             #row
33             {
34                 display: table-row;
35             }
36             #cell
37             {
38                 display: table-cell;
39             }
40         </style>
41     </head>
42     <body>
43         <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>
44         <div id="div1">
45             <div id="div2"></div>
46             <div id="table">
47                 <div id="row">
48                     <div id="cell"></div>
49                 </div>
50             </div>
51         </div>
52     </body>
53 </html>