abspos-009

Right alignment with position:right

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: Right alignment with position:right</title>
 5   <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch">
 6   <link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact">
 7   <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/absolute/012.html" type="text/html">
 8   <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#comp-abspos">
 9   <style type="text/css">
10    body { position: relative; }
11    .control { border-right: 10em solid red; height: 1em; }
12    .test { position: absolute; width: 10em; height: 1em;
13            right: 0; margin: auto;
14            background: green; color: white; }
15   </style> 
16  </head>
17 <body>
18   <p>There should be a green block on the right.</p>
19   <div class="test"></div>
20   <div class="control"></div>
21  
22 </body>
23 </html>