top-113

Top with a value of 'inherit'

WeasyPrint

This browser

Assertion
The 'top' property sets a value of 'inherit', inheriting the value 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: Top with a value of 'inherit'</title>
 5         <link rel="author" title="Microsoft" href="http://www.microsoft.com/">
 6         <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-top">
 7         <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#position-props">
 8         <meta name="flags" content="">
 9         <meta name="assert" content="The 'top' property sets a value of 'inherit', inheriting the value from the parent element.">
10         <style type="text/css">
11             body
12             {
13                 height: 1in;
14             }
15             div
16             {
17                 position: relative;
18             }
19             #div1
20             {
21                 height: 1in;
22                 margin-top: -1in;
23                 top: 100%;
24             }
25             #div2
26             {
27                 background: red;
28                 height: 1in;
29                 margin-top: 1in;
30                 position: absolute;
31                 top: 0;
32                 width: 100%;
33             }
34             #div3
35             {
36                 border-bottom: 1in solid black;
37                 top: inherit;
38             }
39         </style>
40     </head>
41     <body>
42         <p>Test passes if there is no red visible on the page.</p>
43         <div id="div1">
44             <div id="div2"></div>
45             <div id="div3"></div>
46         </div>
47     </body>
48 </html>