---
# System prepended metadata

title: What is the z-index in CSS?

---

# What is the z-index in CSS? 

z-index default value is zero and can take on either a positive or negative number.

An element with a higher z-index is always stacked above than a lower index.

Z-Index can take the following values:

Auto: Sets the stack order equal to its parents.
Number: Orders the stack order.
Initial: Sets this property to its default value (0).
Inherit: Inherits this property from its parent element.

https://blog.hubspot.com/website/z-index


# What are the different units used in CSS?

CSS has two types of lengths. Relative length and absolute length. Different units are used for them.

Relative Length
em
rem
vw
vh
Absolute Length
px
pt
