intermediatetermCSSCSS / Layout / z-index and stacking
IntermediateNot yet reviewed

z-index and stacking

The z-index property sets which overlapping element appears on top.

Definition

The z-index property sets which overlapping element appears on top. It works inside a stacking context, a group that outside elements cannot reach across.

Use case

A dropdown hiding behind other content is usually a stacking context problem. Keep a small set of layer values in your tokens.

In Figma

Layer order

Related terms

Documentation

z-index

MDN · Docs

Includes the rules for when a new stacking context is created.

Suggest a change