Open In App

What is the purpose of the z-index Property ?

The z-index property is a CSS property that controls the stacking order of positioned elements along the z-axis (the axis perpendicular to both the x and y axes) in a web page.

In simpler terms, it determines the visual depth or layering of elements on the screen. The element with a higher z-index value appears in front of elements with lower values. Here’s the purpose of the z-index property in points:

Syntax:

selector {
z-index: value;
}

Components

Article Tags :