The all CSS shorthand property sets all of an element's properties (other than unicode-bidi and direction) to their initial or inherited values, or to the values specified in another stylesheet origin.
/* Global values */ all: initial; all: inherit; all: unset; /* CSS Cascading and Inheritance Level 4 */ all: revert;
The all property is specified as one of the CSS global keyword values. Note that none of these values affect the unicode-bidi and direction properties.
initialinheritunsetrevertunset.revert, the Author origin includes the Override and Animation origins.initial | inherit | unset | revert
<blockquote id="quote"> Lorem ipsum dolor sit amet, consectetur adipiscing elit. </blockquote> Phasellus eget velit sagittis.
body {
font-size: small;
background-color: #F0F0F0;
color: blue;
}
blockquote {
background-color: skyblue;
color: red;
}
all propertyThe <blockquote> uses the browser's default styling together with a specific background and text color. It also behaves as a block element: the text that follows it is beneath it.
all:unsetThe <blockquote> doesn't use the browser default styling: it is an inline element now (initial value), its background-color is transparent (initial value), but its font-size is still small (inherited value) and its color is blue (inherited value).
all:initialThe <blockquote> doesn't use the browser default styling: it is an inline element now (initial value), its background-color is transparent (initial value), its font-size is normal (initial value) and its color is black (initial value).
all:inheritThe <blockquote> doesn't use the browser default styling: it is a block element now (inherited value from its containing <body> element), its background-color is #F0F0F0 (inherited value), its font-size is small (inherited value) and its color is blue (inherited value).
| Specification | Status | Comment |
|---|---|---|
| CSS Cascading and Inheritance Level 4 The definition of 'all' in that specification. | Candidate Recommendation | Added the revert value. |
| CSS Cascading and Inheritance Level 3 The definition of 'all' in that specification. | Candidate Recommendation | Initial definition. |
| Initial value | There is no practical initial value for it. |
|---|---|
| Applies to | all elements |
| Inherited | no |
| Media | There is no practical media for it. |
| Computed value | as the specified value applies to each property this is a shorthand for. |
| Animation type | as each of the properties of the shorthand (all properties but unicode-bidi and direction) |
| Canonical order | the unique non-ambiguous order defined by the formal grammar |
| Desktop | ||||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
| Basic support | 37 | ? | 27 | No | 24 | No |
revert |
No | ? | No | No | No | 9.1 |
| Mobile | |||||||
|---|---|---|---|---|---|---|---|
| Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
| Basic support | No | ? | ? | 27 | No | No | ? |
revert |
No | ? | ? | No | No | 9.3 | No |
CSS global keyword values: initial, inherit, unset, revert
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/CSS/all