CSS z-index property

Usage

Sets how overlapping elements will be stacked, i.e. which one will be shown on top and which one underneath.

Values

  • auto - default, elements inherit their stack level from their parent element
  • [number] - explicitly sets the stack level of the element

Example

Code:

img {
  z-index: 2;
}