In CSS, the z-index property specifies the stack order of elements. An element having a greater stack order is placed in front of an element with a lower stack order.

Here’s its CSS Syntax:

z-index: auto|number|initial|inherit;

Here’s an example to set the z-index of an image:

img {
   position: fixed;
   left: 3px;
   top: 10px;
   z-index: -2;
}

BY Best Interview Question ON 11 Mar 2020