z-index-stack-001.xht (1638B)
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <title>CSS Test: Z-index and stacking levels</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#layers" /> 7 <meta name="assert" content="Boxes with greater stack levels are always formatted in front of boxes with lower stack levels." /> 8 <style type="text/css"> 9 #div1 10 { 11 position: relative; 12 } 13 div div 14 { 15 height: 1in; 16 position: absolute; 17 width: 1in; 18 } 19 #div2 20 { 21 background: orange; 22 left: 30px; 23 top: 30px; 24 z-index: 2; 25 } 26 #div3 27 { 28 background: yellow; 29 left: 60px; 30 top: 60px; 31 z-index: 3; 32 } 33 #div4 34 { 35 background: blue; 36 left: 0; 37 top: 0; 38 z-index: 1; 39 } 40 </style> 41 </head> 42 <body> 43 <p>Test passes if the boxes are partially stacked on top of each other, and they are stacked in the following order from bottom to top: blue, orange, yellow.</p> 44 <div id="div1"> 45 <div id="div2"></div> 46 <div id="div3"></div> 47 <div id="div4"></div> 48 </div> 49 </body> 50 </html>