CSS: Inherit, initial, reset, revert, revert-layer

By Xah Lee. Date: . Last updated: .

CSS global values are keywords that can be applied to any property, in some sense to reset or set to certain sense of default value.

revert

means the browser's default value.

p {
 margin: revert;
}
revert-layer

means the value of the previous Cascade Layer , allowing for specific layer-based overrides.

revert-rule

means the value of the previous rule for the property. (as if the current rule do not exist.)

inherit

means the computed value from its parent element.

use this value to force inheritance.

.x {
 border: inherit;
}
initial

means the initial value as defined by the CSS specification.

unset

value is:

  • same as inherit → if the property has inheritance.
  • same as initial → if the property has non-inheritance.

CSS special property and values