c414-flt-fit-005

Non-Replaced Float Not Fitting Beside Opposite Float

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: Non-Replaced Float Not Fitting Beside Opposite Float</title>
 5   <link rel="help" href="http://www.w3.org/TR/REC-CSS1#floating-elements">
 6   <link rel="author" title="CSS1 Test Suite Contributors" href="http://www.w3.org/Style/CSS/Test/CSS1/current/tsack.html">
 7   <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch">
 8   <style type="text/css">
 9    p { color: navy; }
10    .control { padding: 1em; }
11    .control div { width: 10em; background: navy; color: yellow; }
12    .control div.right { margin-left: 5em; text-align: right; }
13    .test { width: 15em; margin: 1em; }
14    .test div { margin: 0; padding: 0; background: red; }
15    .test p { margin: 0; padding: 0; width: 10em; background: navy; color: yellow; }
16    .test p.left { float: left; text-align: left; }
17    .test p.right { float: right; text-align: right; }
18   </style>
19   <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" title="9.5 Floats">
20   <link rel="help" href="http://www.w3.org/TR/CSS21/text.html#alignment-prop" title="16.2 Alignment: the 'text-align' property">
21  </head>
22  <body>
23   <p>The two patterns below should be identical, with no red present.</p>
24   <div class="control">
25    <div class="left"> &nbsp;</div>
26    <div class="right">&nbsp; </div>
27   </div>
28   <div class="test">
29    <div>
30     <p class="left"> &nbsp;</p>
31     <p class="right">&nbsp; </p>
32    </div>
33   </div>
34  </body>
35 </html>