stack-floats-001

Stacking order: Floats and Blocks in Inlines

WeasyPrint

This browser

Source

 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 2 <html lang="en">
 3  <head>
 4   <title>CSS Test: Stacking order: Floats and Blocks in Inlines</title>
 5   <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch">
 6   <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/float/stacking/001.html" type="text/html">
 7   <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#layers">
 8   <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats">
 9   <style type="text/css">
10    .control { display: inline; font: 1em/1 Ahem, sans-serif; background: red; color: white; }
11 
12    /* outer block */
13    .container { width: 5em; height: 5em; border: solid; font: 20px/1 Ahem; background: red; display: block; }
14 
15    /* top and botom */
16    .float { width: 5em; height: 3em; margin: 0 0 -5em 0; padding: 1em 0; background: red; float: left; }
17    .inline { color: lime; display: inline; }
18 
19    /* middle */
20    .float .block { height: 3em; margin: 0; background: lime; display: block; }
21    .inline .block { height: 3em; margin: 0; background: red; display: block; }
22 
23   </style>
24  </head>
25  <body>
26   <p class="control">Ahem_font_would_be_nice_for_this_test.</p>
27   <p>There should just be a single green square below (with a black border).</p>
28 
29   <div class="container">
30    <div class="float">
31     <div class="block"></div>
32    </div>
33    <div class="inline">
34     XXXXX
35     <div class="block"></div>
36     XXXXX
37    </div>
38   </div>
39 
40  </body>
41 </html>