margin-border-padding-003

Margin, border, padding all display outside the object area

WeasyPrint

This browser

Flags
ahem, image
Assertion
Margin, border, padding render outside the object 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 object 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 image">
 8         <meta name="assert" content="Margin, border, padding render outside the object 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             img
35             {
36                 vertical-align: text-bottom;
37             }
38         </style>
39     </head>
40     <body>
41         <p>Test passes if there is no red visible on the page.</p>
42         <div id="div1">
43             <div id="div2">XXX</div>
44             <div id="div3"><object data="support/margin-border-padding-002.png"></object></div>
45         </div>
46     </body>
47 </html>