CSS all Property
Description
The CSS all property is a powerful shorthand that allows you to reset or redefine almost all CSS properties on an element in a single declaration. Rather than adjusting individual properties one by one, all provides a quick way to control how much styling an element inherits or retains from its parent or from user-agent styles. This makes it especially useful when working with complex layouts, reusable components, or third-party content where unexpected inherited styles can cause inconsistencies. By applying all, you essentially tell the browser how to treat the element’s entire styling context at once.
One of the key strengths of the all property is its ability to neutralize inherited or previously applied styles. For example, when creating isolated UI components, widgets, or embedded elements, you may want them to behave as if they exist in a clean environment. In these cases, all can reset visual characteristics such as layout behavior, typography, spacing, and appearance without manually overriding properties like margin, color, or font. This makes your CSS more maintainable and reduces the chance of missing a property that could affect rendering.
Another important aspect of the all property is how it interacts with inheritance and the cascade. Because it applies broadly, it can dramatically change how an element behaves within the document flow, sometimes requiring you to reapply essential properties such as display or position afterward. For this reason, all is best used intentionally and sparingly, particularly in production layouts. When used thoughtfully, it becomes a powerful tool for creating predictable, self-contained components and simplifying complex CSS structures without sacrificing clarity or control.
Definition
- Initial value
- See individual properties
- Applies to
- See individual properties
- Inherited
- See individual properties
- Computed value
- See individual properties
- Animatable
- See individual properties
- JavaScript syntax
- object.style.all
Interactive Demo
This paragraph has a font size of 1.5rem and a color of gold. It also has 1rem of vertical margin set by the user-agent. The parent of the paragraph is a
Syntax
all: initial | inherit | unset
Values
- initialThis keyword will change all the properties applying to the element or the element to their initial value.
- inheritThis keyword will change all the properties applying to the element or the element to their parent value.
- unsetThis keyword will change all the properties applying to the element or the element to their parent value if they are inheritable or to their initial value if not.
Example
Browser Support
The following information will show you the current browser support for the CSS all property. Hover over a browser icon to see the version that first introduced support for this CSS property.
This property is supported by all modern browsers.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 1st January 2026
