The cover of The Complete Idiot's Guide to Create a Web Page The Complete Idiot's Style Sheets Reference

| Index | Current Category: Positioning |
| Previous Style: word-spacing |


z-index

Determines the element's position in the stacking order.

Support:

W3C StandardInternet ExplorerNetscape Navigator
CSS2 and later 4.0 and later 4.0 and later
Notes:
  • The stacking order is the order that elements are stacked upon each other (sometimes also called the z-order). An element's position in the stacking order is called its stack level.
  • An element with a higher z-index value is displayed "on top" of an element with a lower z-index value.
  • This style replaces the HTML <LAYER Z-INDEX> attribute.
Possible Values:
auto
The stack level is determined by the page layout.

Support:

W3C StandardInternet ExplorerNetscape Navigator
CSS2 and later 4.0 and later Not supported

[integer]
The specified stack level of the element.

Support:

W3C StandardInternet ExplorerNetscape Navigator
CSS2 and later 4.0 and later 4.0 and later

Example:
<IMG 
   SRC="home2.gif" 
   STYLE="z-index: 0; position: absolute; left: 100px; top: 10px">
<DIV STYLE="z-index: 1; position: absolute; left: 10px; top: 30px">
<B>This text appears on top of the image.</B>
</DIV>
How It Looks:
Head for zindexex.htm to see this example in action.

| Index | Current Category: Positioning |
| Previous Style: word-spacing |