Z-index is a property in CSS that is used to define the order of elements on a web page. It works on the basis of order indices, where a higher-order element will appear before a lower-order element.
It only applies to elements that are positioned, i.e., those elements having the position attribute compulsorily.
Consider the following example:
div {
position: fixed;
left: 15px;
top: 20px;
z-index: -1;
}