If we are overlapping the elements vertically then we must use a z-index. It provides the vertical stack order of the elements. The default value we need to take is 0 in positive or negative. Also, we can the given values for z-index:
- Inherit.
- Initial.
- Auto.
- Number.