z-index-abspos-008

z-index

WeasyPrint

This browser

Source

 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 2 <html lang="en">
 3  <head>
 4   <title>CSS Test: z-index</title>
 5   <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch">
 6   <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/absolute/z-index/008.html" type="text/html">
 7   <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#z-index">
 8   <link rel="help" href="http://www.w3.org/TR/CSS21/zindex.html#painting-order">
 9   <style type="text/css">
10    div { position: absolute; width: 4em; height: 4em; }
11    .a { top: 1em; left: 1em; width: 12em; height: 12em; background: gray; }
12    .b { top: 1em; left: 4em; background: blue; }
13    .d { top: 4em; left: 7em; background: orange; }
14    .e { top: 3em; left: -3em; background: yellow; z-index: 1; }
15    .c { top: 3em; left: -3em; background: lime; z-index: 2; }
16    .text { top: 14em; width: 30em; }
17   </style>
18  </head>
19  <body>
20   <div class="a">
21    <div class="b">
22     <div class="c">
23     </div>
24    </div>
25    <div class="d">
26     <div class="e">
27     </div>
28    </div>
29   </div>
30   <div class="text">The squares should overlap each other clockwise, so that the
31   top one (blue) is the bottommost and the one to its left (green) is the 
32   topmost.</div>
33  </body>
34 </html>