The all property is a CSS shorthand that lets you reset or inherit every CSS property on an element with a single declaration. It is especially useful when you need a clean slate or want a child to fully match its parent styling.
01
Global Reset
Change every property at once.
02
Syntax
One keyword, one rule.
03
initial
Return to spec defaults.
04
inherit
Adopt parent styles.
05
unset
Smart reset behavior.
06
When to Use
Components, widgets, resets.
Fundamentals
Definition and Usage
The all CSS property is a shorthand that resets or sets all of an element’s CSS properties to a single keyword value. Instead of writing many separate reset rules, you can apply all: initial, all: inherit, or all: unset in one line.
This is helpful when embedding third-party content, isolating a component from surrounding styles, or quickly undoing inherited styling on a nested element.
💡
Beginner Tip
Think of all as a master switch. initial wipes styles back to browser defaults, inherit copies the parent, and unset chooses the smarter option for each property.
Foundation
📝 Syntax
Apply all like any other CSS property. The value is always one global keyword:
all accepts global keywords, not individual values like colors or lengths.
It affects all standard CSS properties except unicode-bidi and direction.
CSS custom properties (--variables) are not reset by all.
After using all: initial, you may need to re-add properties like display for layout.
Use revert or revert-layer in modern browsers when you want browser-default styling instead of spec initial values.
Cheat Sheet
⚡ Quick Reference
Question
Answer
Applies to
All elements
Inherited
No
Animatable
No
Most common values
initial, inherit, unset
Common use
Resetting embedded content or isolating a component
Defaults
Default Value
Elements do not use the all property by default. Each CSS property keeps its own normal initial or inherited value until you write a rule. You only see the effect of all when you explicitly set it on a selector.
Reference
💎 Property Values
These global keywords control how every CSS property on the element is treated.
Value
Example
Meaning
initial
all: initial;
Resets every property to its CSS specification initial value
inherit
all: inherit;
Makes every property inherit from the parent element
unset
all: unset;
Uses inherit for normally inherited properties and initial for the rest
revert
all: revert;
Rolls properties back to the browser stylesheet level
revert-layer
all: revert-layer;
Rolls back to the previous cascade layer, if layers are used
initial
The child starts with bold red underlined styling, then all: initial removes those custom styles and returns to browser defaults.
Parent context
Reset with all: initial
Custom color, weight, and underline are cleared.
inherit
The child had its own red styling, but all: inherit makes it match the parent’s blue serif text instead.
Parent: Georgia, dark blue, bold
Child inherits everything
Font, color, and weight come from the parent.
unset
all: unset is a balanced reset: inherited properties like color follow the parent, while non-inherited properties return to initial values.
Parent: Georgia, dark blue, bold
Smart reset with all: unset
Useful when you want a softer reset than initial.
Compare
initial vs inherit vs unset
Keyword
What it does
Best for
initial
Every property goes to its CSS default
Hard resets and blank-slate components
inherit
Every property copies the parent
Nested content that should fully match a theme
unset
Inherited props inherit; others reset to initial
Flexible resets that keep natural text inheritance
Scope
What Properties Does all Affect?
The all shorthand applies to all CSS properties except:
unicode-bidi
direction
It does not remove CSS custom properties you defined with --name. After a reset, you can still reference variables from ancestor elements unless you override them separately.
Preview
👀 Live Preview
Compare a normal styled paragraph with one reset using all: initial:
Normal paragraph
This paragraph keeps custom red styling.
Reset paragraph
This paragraph was reset with all: initial.
Hands-On
Examples Gallery
Try all with initial, inherit, unset, and a practical component reset.
📚 Reset Keywords
These examples show the three most common all keywords beginners use when clearing or copying styles.
Example 1 — Reset All Styles with initial
Remove custom styling from a paragraph and return it to browser default values.
all-initial.html
<style>p{color:red;}.reset-style{all:initial;}</style><p>This turns red.</p><pclass="reset-style">
This paragraph has all styles reset to initial values.
</p>
This paragraph has all styles reset to initial values.
How It Works
The first paragraph keeps the global p { color: red; } rule. The second paragraph uses all: initial, so custom color and other inherited styling are cleared.
Example 2 — Inherit All Styles from a Parent
Make a child element fully adopt the parent’s font and color styling.
all-inherit.html
<style>.parent{font-family:Arial, sans-serif;color:darkblue;}.child{all:inherit;}</style><divclass="parent"><pclass="child">
This paragraph inherits its styles from its parent.
</p></div>
The widget button ignores the global purple pill styling because all: initial clears inherited and applied styles first, then you rebuild only what the widget needs.
🧠 How the all Property Works
1
You choose one global keyword
Write all: initial, inherit, or unset on a selector.
Keyword
2
CSS applies it to every property
The browser updates all standard longhand properties on that element at once, except unicode-bidi and direction.
Cascade
3
You rebuild only what you need
After a hard reset, add back layout and design rules like display, padding, or borders.
Follow-up rules
=
🛠
Clean, predictable styling
One declaration gives you a controlled reset or inheritance strategy without listing dozens of properties.
Compatibility
Universal Browser Support
The all property is supported in all modern browsers. Keywords like revert and revert-layer have slightly newer support.
✓ Baseline · Modern browsers
Reset styles reliably in today’s browsers
Chrome, Firefox, Safari, Edge, and Opera support initial, inherit, and unset through the all shorthand.
97%Modern browser support
Google Chrome37+ · Desktop & Mobile
Full support
Mozilla Firefox27+ · Desktop & Mobile
Full support
Apple Safari9.1+ · macOS & iOS
Full support
Microsoft Edge79+ · Chromium
Full support
Opera24+ · Modern versions
Full support
Newer keywords
revert and revert-layer are supported in current browsers but are newer than the core shorthand.
💻
Internet ExplorerNo support for all
None
all property97% supported
Bottom line: Use all confidently in modern projects, but test hard resets on interactive elements like buttons and links.
Wrap Up
Conclusion
The all property is a powerful CSS shorthand for resetting or inheriting every property at once. It saves time when you need a clean baseline or want nested content to fully match a parent theme.
For beginners, remember the three main keywords: initial for a hard reset, inherit for copying the parent, and unset for a smarter mixed reset.
Use all: unset when you want a softer reset than initial
Re-add essential properties like display after a hard reset
Scope resets to a component class such as .widget
Test buttons, links, and form controls after using all
Prefer targeted resets when only a few properties need changing
❌ Don’t
Apply all: initial globally to every element on a page
Assume CSS variables are cleared by all
Forget that initial is not always the same as browser default styling
Use all when resetting one or two properties would be clearer
Skip visual testing in the browsers your users actually use
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about all
Use these points when resetting or inheriting styles.
5
Core concepts
🛠01
Shorthand Reset
One rule, every property.
Purpose
🔄02
initial
Hard spec defaults.
Reset
🔁03
inherit
Copy parent styles.
Cascade
⚡04
unset
Smart mixed behavior.
Flexible
💡05
Rebuild After
Add display and layout back.
Careful
❓ Frequently Asked Questions
The all property is a shorthand that applies one keyword to every CSS property on an element at the same time. It is useful for resetting styles or forcing inheritance from a parent.
initial resets every property to its spec default. unset is smarter: inherited properties behave like inherit, and non-inherited properties behave like initial.
Use it when a child element should fully adopt the parent styling context, such as embedding content inside a themed container.
It affects all standard CSS properties except unicode-bidi and direction. Custom properties (CSS variables) are not reset by all.
Yes, but use it carefully. all: initial can remove useful defaults like display on buttons, so test the result before applying it broadly.