margin-007

Margin set to 'inherit', inheriting two values

WeasyPrint

This browser

Assertion
The 'margin' property set to 'inherit', inherits two values from the parent element.

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 set to 'inherit', inheriting two values</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#propdef-margin">
 7         <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#margin-properties">
 8         <meta name="flags" content="">
 9         <meta name="assert" content="The 'margin' property set to 'inherit', inherits two values from the parent element.">
10         <style type="text/css">
11             #wrapper
12             {
13                 position: relative;
14             }
15             #div1, #div2
16             {
17                 border: 10px solid green;
18             }
19             #div1, #reference
20             {
21                 position: absolute;
22             }
23             #div1
24             {
25                 left: 0;
26                 margin: 2.54cm 0.25in;
27                 top: 0;
28             }
29             #div2
30             {
31                 height: 1in;
32                 margin: inherit;
33                 width: 3in;
34             }
35             #reference
36             {
37                 border: 10px solid red;
38                 height: 308px;
39                 left: 0.25in;
40                 top: 1in;
41                 width: 356px;
42             }
43         </style>
44     </head>
45     <body>
46         <p>Test passes if there is no red visible on the page.</p>
47         <div id="wrapper">
48             <div id="reference"></div>
49             <div id="div1">
50                 <div id="div2"></div>
51             </div>
52         </div>
53     </body>
54 </html>