floats-144

Floats inside blocks

WeasyPrint

This browser

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 inside blocks</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/044.html" type="text/html">
 7   <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats">
 8   <style type="text/css">
 9    p { float: left; color: green; margin: 0; }
10    div { background: red; clear: both; }
11    div.a { }
12    div.b { width: 30em; }
13    div.c { height: 0; }
14   </style>
15  </head>
16  <body>
17   <div class="a"><p>This line should be green (line 1).</p></div>
18   <div class="b"><p>This line should be green (line 2).</p></div>
19   <div class="c"><p>This line should be green (line 3).</p></div>
20  </body>
21 </html>