The unset CSS keyword

❮ CSS References

Meaning

The unset CSS keyword resets a property to its inherited value if the property naturally inherits from its parent, and to its initial value if not.

In other words, it behaves like the inherit keyword in the first case, when the property is an inherited property, and like the initial keyword in the second case, when the property is a non-inherited property.

The unset can be applied to any CSS property, including the CSS shorthand property all.







Browser Support

The numbers in the table specify the first browser version that fully supports the property.




Status







Example

color is an inherited property:

Example

.foo {
  color: blue;
}

.bar {
  color: green;
}

p {
  color: red;
}

.bar p {
  color: unset;
}

border is a non-inherited property:

Example

div {
  border: 1px solid green;
}

p {
  border: 1px solid red;
}

.bar p {
  border-color: unset;
}



See also:

❮ CSS References