stack-floats-002

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/002.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    .inner { display: block; }
15 
16    /* top and botom */
17    .float { width: 5em; height: 3em; margin: 0 0 -5em 0; padding: 1em 0; background: red; float: left; }
18    .inner .inline { color: lime; display: inline; }
19 
20    /* middle */
21    .float .block { height: 3em; margin: 0; background: lime; display: block; }
22    .inner .block { height: 3em; margin: 0; background: red; display: block; }
23 
24   </style>
25  </head>
26  <body>
27   <p class="control">Ahem_font_would_be_nice_for_this_test.</p>
28   <p>There should just be a single green square below (with a black border).</p>
29 
30   <div class="container">
31    <div class="float">
32     <div class="block"></div>
33    </div>
34    <div class="inner">
35     <div class="inline">XXXXX</div>
36     <div class="block"></div>
37     <div class="inline">XXXXX</div>
38    </div>
39   </div>
40 
41  </body>
42 </html>