# Stacking order

*noun*

say it: **“STAK-ing OR-der”** **/ˈstækɪŋ ˈɔrdər/**

The order in which the browser paints overlapping layers: backgrounds first, then normal content, then positioned elements from the lowest z-index to the highest.

## What is the **stacking order**?

The **stacking order** is the order layers are drawn in a stacking context: backgrounds first, then normal content, then positioned elements by `z-index`.

```css
.overlay { position: absolute; z-index: 2; }
.content { position: relative; z-index: 1; }   /* drawn under .overlay */
```

## In a sentence

- “By the **stacking order**, the positioned badge is painted after the card's text, so it sits on top.”

Level: Master · [More CSS terms at this level](https://www.ask-codey.com/glossary?category=css&level=5)

Updated: November 9, 2026

Source: https://www.ask-codey.com/glossary/stacking-order
