CSS all Property

Beginner
6 min read
Updated: Oct 2026
3 examples
Live preview

Definition and Usage

The all property sets every CSS property on an element to one keyword. Use it to wipe an element's own styles, or to make it take its styles from the parent.

It does not change direction, unicode-bidi, or custom properties. A property written after all is kept. The property is not inherited.

Standard-track.

Not deprecated. initial, inherit, and unset are widely supported. revert-layer needs a newer browser. revert-rule is newer still and is not in the everyday set.

CSS Syntax

syntax.css
all: initial | inherit | unset | revert | revert-layer;

Property Values

ValueDescriptionTry it
initialEvery property goes to its spec default. color becomes black. display becomes inlineTry it
inheritEvery property copies the parent, including ones that do not normally inherit, such as background-colorTry it
unsetInherited properties copy the parent. The rest go to their initial valueTry it
revertDrops the author styles for this element and uses the browser's stylesheet insteadTry it
revert-layerRolls properties back to the previous cascade layer. With no layer, it matches revertTry it

How to Use all

Give the element a style you can see, then replace all of it with one keyword.

  1. Set a parent color so inheritance has something to copy.
  2. Set a different color and background-color on the element.
  3. Add all with one keyword: initial, inherit, unset, or revert.
  4. Put any property you still want after all. A property written before it is wiped.
PieceRequired?Role
A visible styleYes, to see itcolor and background-color show what was cleared
A parent colorFor inherit and unsetThe value those keywords copy
One keywordYesall accepts only a global keyword, not a color or a length

Live Preview

Both lines start red on a light blue background. The parent text is blue. Only the second line uses all.

The first line stays red. The second line is the one you reset.

Result

Kept

Changed

all: initial

CSS Examples

Each snippet paints a paragraph, then lets all replace those styles. Use Try It Yourself for a live editor.

Example 1 — Reset to the Spec Default

The first paragraph stays red. The second drops its color and background.

CSS
<style>
  article {
    color: blue;
  }
  p {
    color: red;
    background-color: skyblue;
  }
  .reset {
    all: initial;
  }
</style>

<article>
  <p>Kept</p>
  <p class="reset">Reset</p>
</article>
Try It Yourself

How It Works

  1. Paint the parent. color: blue on article is what a child could inherit.
  2. Paint the paragraphs. Both would be red on a sky-blue background.
  3. Reset one of them. all: initial sets every property to its spec default. Red and sky blue are gone.
  4. Read the defaults. color becomes black, not the parent's blue. display becomes inline, so "Reset" no longer forms its own block.

Example 2 — Copy the Parent

The second paragraph takes the parent's color and background, not its own.

CSS
<style>
  article {
    color: blue;
    background-color: #eee;
  }
  p {
    color: red;
    background-color: skyblue;
  }
  .copy {
    all: inherit;
  }
</style>

<article>
  <p>Kept</p>
  <p class="copy">Copied</p>
</article>
Try It Yourself

How It Works

  1. Style the parent. Blue text on a light gray background.
  2. Style the paragraphs. Red text on sky blue, which would normally win.
  3. Copy everything. all: inherit replaces those rules with the parent's computed values.
  4. Background comes along. background-color does not inherit by itself. all: inherit forces it to, so the gray shows through.

Example 3 — Inherit What Inherits

Color and size come from the parent. The background does not.

CSS
<style>
  article {
    color: blue;
    font-size: 14px;
  }
  p {
    color: red;
    background-color: skyblue;
    font-size: 24px;
  }
  .mix {
    all: unset;
  }
</style>

<article>
  <p>Kept</p>
  <p class="mix">Mixed</p>
</article>
Try It Yourself

How It Works

  1. Set two kinds of properties. color and font-size inherit. background-color does not.
  2. Make the paragraph different. It would be red, 24px, and sky blue.
  3. Split the reset. all: unset inherits color and font-size, so the text is blue and 14px.
  4. Drop the rest. The background goes to its initial value, transparent. all: initial would also have turned the text black.

Edge Cases & Pitfalls

If a style survives, one of these is usually why.

skip

Three things are never reset

direction, unicode-bidi, and custom properties stay. all does not change them.

inline

initial makes the element inline

The initial value of display is inline. A p, div, or heading can jump onto the same line as the text around it.

order

A property after all is kept

all: initial; color: green; ends green. The same color written before all is wiped.

unset

unset is not a full wipe

Inherited properties, including color and font-size, still come from the parent. Only the non-inherited ones go back to their initial value.

form

Form controls lose their browser look

all: initial on a button or input removes the user-agent border, background, and font. Put the styles you still need after all.

Browser Support

all is a browser style property. Node.js, Deno, and Bun do not apply it. Internet Explorer does not support it.

✓ Baseline · Widely available since 2020

all

Chrome 37+, Firefox 27+, Safari 9.1+, Edge 79+. No Internet Explorer. revert and revert-layer need newer versions.

95% initial, inherit, and unset
Google Chrome 37+ · unset from 41
Full support
Mozilla Firefox 27+
Full support
Apple Safari 9.1+
Full support
Microsoft Edge 79+ · Chromium
Full support
Opera 24+
Full support
Samsung Internet 3+
Full support
Internet Explorer No support
Not supported
all Widely supported

Bottom line: all: revert needs Chrome 84, Firefox 67, or Safari 9.1. all: revert-layer needs Chrome 99, Firefox 97, or Safari 15.4. Legacy Edge and Internet Explorer ignore the property.

Key Takeaways

  • Role: one keyword for every property on the element.
  • initial: spec defaults. Text turns black, and the element becomes inline.
  • unset: inherited properties copy the parent. Everything else is reset.
  • Left alone: direction, unicode-bidi, and custom properties.

One line: all replaces the element's styles with one keyword. Write anything you want to keep after it.

Frequently Asked Questions

It sets every CSS property on an element to one keyword, such as initial or inherit. It is a shorthand for all properties except unicode-bidi, direction, and custom properties.
initial sets every property to its spec default, so color becomes black and a paragraph becomes inline. unset inherits properties that normally inherit, such as color and font-size, and resets the rest.
No. Custom properties, direction, and unicode-bidi stay as they are. A later declaration can also put one property back after all.
The initial value of display is inline. all: initial applies that, so a p or div no longer sits on its own line.
Chrome 37+, Firefox 27+, Safari 9.1+, and Edge 79+ support all. Internet Explorer does not. revert and revert-layer need newer versions. It is a browser style property, not a Node.js feature.

Next: animation

Move from a one-keyword reset to properties that change over time.

animation tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful