CSS: global values
css global values
CSS global values are universal keywords defined in the CSS Cascading and Inheritance specification that can be applied to any property to control how a property gets its final value, overriding or bypassing normal cascade rules.
The five primary global keywords are:
inherit: Specifies that the property should take the computed value from its parent element.initial: Specifies that the property should be set to its initial, default value as defined by the CSS specification.unset: Acts as a combination of inherit and initial; if the property is naturally inherited, it inherits, otherwise it resets to the initial value.revert: Resets the property to the value set by the user-agent stylesheet or the user's preferences, effectively undoing author styles.revert-layer: Resets the property to the value set by the previous cascade layer, allowing for specific layer-based overrides.
These keywords are particularly useful when used with the all shorthand property to reset an element's styles (excluding unicode-bidi, direction, and custom properties) to their initial, inherited, unset, or reverted states.