abspos-001

CSS Absolute Positioning: static position after previous margin

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: CSS Absolute Positioning: static position after previous margin</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/absolute/001.xml" type="application/xhtml+xml">
 7   <link rel="reviewer" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact">
 8   <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#comp-abspos">
 9      <style type="text/css">
10    /* Set Up Conditions */
11    * { margin: 0; padding: 0; border: 0;
12        position: static; float: none; display: block;
13        top: auto; left: auto; right: auto; bottom: auto; }
14    head { display: none; }
15    body { padding: 1em; }
16    /* Test */
17    .margin { margin-bottom: 2em; }
18    .abs { position: absolute; background: green; z-index: 1; height: 1em; width: 10em; }
19    .flow { background: red; height: 1em; width: 10em; }
20   </style>
21  </head>
22  <body>
23 
24   <div class="margin">This page should have a single green rectangle below this paragraph and no red.</div>
25   <div class="abs"></div> <div class="flow"></div>
26 
27  </body>
28 </html>