margin-border-padding-001

Margin, border, padding all display outside the content area

WeasyPrint

This browser

Flags
ahem
Assertion
Margin, border, padding render outside the content area.

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: Margin, border, padding all display outside the content area</title>
 5         <link rel="author" title="Microsoft" href="http://www.microsoft.com/">
 6         <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#box-dimensions">
 7         <meta name="flags" content="ahem">
 8         <meta name="assert" content="Margin, border, padding render outside the content area.">
 9         <style type="text/css">
10             div
11             {
12                 font: 1em Ahem;
13                 margin: 1em;
14                 left: 0;
15                 padding: 1em;
16                 position: absolute;
17                 top: 0;
18             }
19             #div1
20             {
21                 position: relative;
22             }
23             #div2
24             {
25                 background: red;
26                 border: 1em solid red;
27                 color: red;
28             }
29             #div3
30             {
31                 background: black;
32                 border: 1em solid black;
33             }
34         </style>
35     </head>
36     <body>
37         <p>Test passes if there is no red visible on the page.</p>
38         <div id="div1">
39             <div id="div2">XXX</div>
40             <div id="div3">XXX</div>
41         </div>
42     </body>
43 </html>