all
The all shorthand CSS property resets all of an element's properties except unicode-bidi, direction, and CSS Custom Properties. It can set properties to their initial or inherited values, or to the values specified in another cascade layer or stylesheet origin.
Browser support
| Feature | Desktop | Mobile | ||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Safari | Chrome Android | Safari iOS | |
| 37 | 79 | 27 | 9.1 | 37 | 9.3 | |
1+Supported (version) Not supported ※Has note Sub-feature descriptions sourced from MDN Web Docs (CC BY-SA 2.5)
Syntax
CSS
/* Reset all styles to their initial values */
.reset-all {
all: initial;
}
/* Reset to the user agent's defaults */
.reset-to-default {
all: revert;
}
/* Clear inherited values and reset to unset */
.widget-container {
all: unset;
display: block;
padding: 1rem;
} Live demo
Use cases
-
Using all
The all shorthand CSS property resets all of an element's properties except unicode-bidi, direction, and CSS Custom Properties.
Cautions
- May not be supported in older browsers.
Accessibility
- Make sure visual changes are conveyed appropriately to assistive technology.