CSS z-index

The CSS z-index property controls which positioned element appears in front of another element.

z-index: 1
z-index: 2
z-index: 3

How z-index works

A higher z-index value places an element above an element with a lower z-index value.

In this example:

Therefore, Box 3 appears in front of Box 2 and Box 1.