CSS property: z-index

Description

The stack level.

For a positioned box, the z-index property specifies:

  1. The stack level of the box in the current stacking context.
  2. Whether the box establishes a stacking context.

Syntax

z-index: auto | <integer>;

Values

auto (by default)

The stack level of the generated box in the current stacking context is 0. The box does not establish a new stacking context unless it is the root element.

<integer>

This integer is the stack level of the generated box in the current stacking context. The box also establishes a new stacking context.

Versions

Examples

p {
    position: absolute;
    z-index: 7;
}