# Property Description

The z-index property sets the stack order of an element.

An element with greater stack order is always in front of an element with a lower stack order.

Note: z-index only works on positioned elements (position:absolute, position:relative, or position:fixed).

# Property Values

Value | Description
--- | ---
auto | (default) Sets the stack order equal to its parents
number | Sets the stack order of the element. Negative numbers are allowed
inherit1 | Specifies that the value of the property should be inherited from the parent element

# Examples

This example sets the z-index for an image.

    img {
      position:absolute;
      left:0px;
      top:0px;
      z-index:-1;
    }

# Browser Support

Firefox | IE | Chrome | Opera | Safari

1 - 'inherit' not supported by IE

# Miscellaneous Information

Inherited: | No
Defined In: | CSS2