CSS - all Property
CSS - all Property
CSS all property resets all properties of an element, with the exception of unicode bidi , direction and CSS custom properties . It can reset properties to their original or inherited values or to the values explicitly defined in another cascade layer or in the stylesheet origin.
Syntax
all: initial | inherit | unset;Property Values
| Value | Description |
|---|---|
| initial | It changes all the properties applied to an element or to its parent to their initial value. |
| inherit | It changes all the properties applied to an element or to its parent to their parent value. |
| unset | It changes all the properties applied to the element or the elementβs parent to their parent value if they are inheritable else to their initial value if not |
Examples of CSS All Property
The following example explains the all property with different values.
All Property with Initial Value
To let an elementβs properties be set to their default values assigned by the browser such that no defined styling is applicable to them, we use the initial value. This is shown in the following example.
Example
All Property with Inherit Value
To let an elementβs properties be set to the properties of the elementβs parent or the html element then, we use the inherit value. The properties defined by the parent if present will be applied if not then the html element properties will be applied. This is shown in the following example.
Example
All Property with Unset Value
To let the properties of an element be obtained from its parent if present or from html element if absent or from the default values decided by the browser (behave like initial) in the absence of both then, we use unset value. This is shown in the following example.
Example
Supported Browsers
| Property | |||||
|---|---|---|---|---|---|
| all | 37.0 | 79.0 | 27.0 | 9.1 | 24.0 |