How to set element Layer (z-index) in CSS?

z-index property is used to set the layer of elements. We can set this property to auto (default) and number. It works only with position property value: fixed, relative, absolute.

The element which has a higher number appears at the top.

Ex: –

img {
position: fixed;
z-index: 565;

What is Z-Index and How Does It Work? - SpyreStudios
Tagged : / / /