z-index-applies-to-012.xht (1368B)
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 applied to element with 'display' set to inline-block</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="assert" content="The 'z-index' property applies to elements with a display of inline-block." /> 9 <style type="text/css"> 10 div 11 { 12 line-height: 0; 13 } 14 #div1 15 { 16 background: green; 17 display: inline-block; 18 z-index: 1; 19 } 20 #zindex 21 { 22 background: red; 23 top: -1in; 24 } 25 #div1, #zindex 26 { 27 height: 1in; 28 position: relative; 29 width: 1in; 30 } 31 </style> 32 </head> 33 <body> 34 <p>Test passes if there is no red visible on the page.</p> 35 <div> 36 <div id="div1"></div> 37 <div id="zindex"></div> 38 </div> 39 </body> 40 </html>