z-index-014

Z-index: inherit sets a value the same as parent element's value

WeasyPrint

This browser

Assertion
The property z-index set to 'inherit' sets a value the same as parent element's computed value.

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: Z-index: inherit sets a value the same as parent element's value</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-z-index">
 7         <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#z-index">
 8         <meta name="flags" content="">
 9         <meta name="assert" content="The property z-index set to 'inherit' sets a value the same as parent element's computed value.">
10         <style type="text/css">
11             #div1
12             {
13                 background: green;
14                 height: 1in;
15                 left: 0;
16                 position: absolute;
17                 top: 0;
18                 width: 1in;
19                 z-index: -1;
20                 z-index: inherit;
21             }
22             #div2
23             {
24                 background: red;
25                 height: 1in;
26                 left: 0;
27                 position: absolute;
28                 top: 0;
29                 width: 1in;
30             }
31             #wrapper
32             {
33                 position: relative;
34                 z-index: 1;
35             }
36         </style>
37     </head>
38     <body>
39         <p>Test passes if there is no red visible on the page.</p>
40         <div id="wrapper">
41             <div id="div1"></div>
42             <div id="div2"></div>
43         </div>
44     </body>
45 </html>