floats-138

Clearing a float with margins

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: Clearing a float with margins</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/038.html" type="text/html">
 7   <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats">
 8   <style type="text/css">
 9    div { color: navy; }
10    .float { float: left; width: 8em; }
11    .indent { margin: 0 0 0 10em; }
12    .clear { clear: both; }
13   </style>
14  </head>
15  <body>
16   <p>There should be two lines below, the second indented some way across.</p>
17   <div class="float">Line 1</div>
18   <div class="indent">
19    <div class="clear">Line 2</div>
20   </div>
21  </body>
22 </html>