1. Home
  2. Computing & Technology
  3. Web Design / HTML

z-index

By Jennifer Kyrnin, About.com

z-index Description:

The z-index property defines the stack level of the box in the current context, and whether there is a local stacking context.

z-index in CSS Versions:

z-index Syntax:

z-index: auto | <integer> | inherit

  • auto
    The stack level is the same as its parent's stack level. No new local stacking context.
  • <integer>
    The stack level of the generated box in the current stacking context. It is 0 in the local stacking context.
  • inherit
    The element should have the same z-index value as the parent element.

z-index Initial Value:

auto

z-index Applies To:

All positioned elements.

z-index Inheritance:

This property is not inherited.

z-index Browser Support:

z-index Media Type:

  • Visual

z-index Examples:

Standard z-index property

<p style="z-index:100;">
This paragraph will be above any element that has a z-index of 99 or lower.
</p>

z-index Special Notes:

  • The z-index will only work if the position property is set as well.

More z-index Information

Return to the Style Library

Explore Web Design / HTML

More from About.com

  1. Home
  2. Computing & Technology
  3. Web Design / HTML
  4. CSS
  5. Style Properties
  6. CSS Style Property: z-index

©2008 About.com, a part of The New York Times Company.

All rights reserved.