floats-154

Stacking contexts of relatively positioned content inside floats

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: Stacking contexts of relatively positioned content inside floats</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/054.html" type="text/html">
 7   <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats">
 8   <style type="text/css">
 9    body { font-size: 8em; }
10    p { font-size: medium; }
11    .float { float: left; height: 1em; width: 1em; margin-right: -1em; background: red; }
12    .relative { position: relative; height: 1em; width: 1em; background: green; }
13    .inline { color: red; }
14   </style>
15  </head>
16  <body>
17   <p>There should be a green box below, with no text and no red.</p>
18   <div class="float"><div class="relative"></div></div>
19   <div class="inline">X</div>
20  </body>
21 </html>