MDN Web Docs
- position
- unset
In theory, all the position values have eight: position: static | relative | absolute | fixed | sticky | initial | inherit | unset
The most common ones are static, relative, absolute, fixed and sticky
Initial, inherit, and unset are the keywords of CSS. You can set these values to any CSS property
Static vs. unset
position: static
This keyword specifies the normal layout behavior of the element, that is, the current layout position of the element in the general flow of the document. The top, right, bottom, left, and Z-index attributes are invalid.
position: unset
If the CSS keyword unset is inherited from its parent, the property is reset to the inherited value, if the parent style is not inherited, the property is reset to its initial value. In other words, in the first case (inherited properties) it behaves like Inherit, and in the second case (non-inherited properties) like Initial. It can be applied to any CSS property, including the CSS shorthand all.
Position: unset = position:initial = position:static
What does that mean? When we unset a CSS property:
- If the property is a default inherited property, this value is equivalent to
inherit
- If the property is non-inherited, the value is equivalent to
initial
For example, color is inheritable, so color: unset is equal to color:inherit, and border:unset is equal to border:initial
Further reading
- Inheritable and non-inheritable styles in CSS
- The value of the position property