root-box-001

Placing the root element

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: Placing the root element</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/root/001.xml" type="application/xhtml+xml">
 8   <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#Computing_heights_and_margins">
 9   <style type="text/css">
10    html { margin: 1em; border: 1em solid red; padding: 0; background: green; }
11    body { margin: 0; border: 0; padding: 0; background: red; }
12    p { margin: -1em; border: 0; padding: 1em; background: white; }
13   </style>
14  </head>
15  <body>
16   <p>This text should be in a white box surrounded by green that extends
17      to all edges of the viewport.</p>
18  </body>
19 </html>