z-index-abspos-009

CSS: z-index and the canvas and background propagation

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: CSS: z-index and the canvas and background propagation</title>
 5   <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch">
 6   <link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact">
 7   <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/absolute/z-index/canvas/001.html" type="text/html">
 8   <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#z-index">
 9   <link rel="help" href="http://www.w3.org/TR/CSS21/zindex.html#painting-order">
10   <style type="text/css">
11    * { background: transparent; margin: 0; }
12    html { margin: 5em auto;
13           height: 35px; width: 35px;
14           border: solid 10px red;
15           background: transparent; }
16    body { background: transparent url(support/swatch-red.png) no-repeat center;
17           height: 15px; width: 15px;
18           border: 10px solid green; }
19    div { background: red url(support/swatch-green.png) center no-repeat;
20          height: 15px; width: 15px; padding: 9px;
21          border: solid 10px green;
22          position: absolute; margin-top: -19px; margin-left: -19px; z-index: -1; }
23    p { position: absolute; top: 0; left: 0; margin: 1em; }
24   </style>
25  </head>
26  <body>
27    <p>There should be a completely-filled green square and no red.</p>
28   <!--
29 
30    The <div> should be under the <body> box but above the canvas and <html>
31    backdrop.
32 
33    !-->
34   <div></div>
35  </body>
36 </html>