CSS all Property

The all property resets all element properties.

Their values are reset to their default or inherited values.

This property is used to reset styles and start with a clean slate.

Example

#

A child element with all set to initial.

The style in this element is reset to its initial or default value.
<div style="color: red;">
  <div style="all: initial;">
    The style in this element is reset
    to its initial or default value.
  </div>
</div>

Code Explanation

The container defines a red color which is inherited by its children.

However, the child element has an all:initial value.

The parent style is not inherited and the child uses initial values.


Using all

The all property resets an element's properties to their initial values.

This property is used in complex CSS situations to start with a clean slate.

Valid property values include: initial, inherited, and specified values.

The direction and unicode-bidi properties cannot be reset using all.

Note: The unicode-bidi property is used together with the direction property to specify whether the originial text can be overridden to support multiple languages. It is used by right-to-left written languages such as Arabic or Hebrew.
Note: Not all browsers support the all property.

Syntax

all: initial | inherit | unset;

Values

#

Value Description
initial Resets to the initial value
inherit Inherits the parent's value
unset Inherits all possible values from the parent. If no inheritable value is available for the property, the initial value is used.

More Examples

Click the buttons to see the different all values.

The style of this element is reset depending on the all value
<style>
  .my-all {
    all: unset;
  }
</style>

<div style="color: orangered; ">
  <div class="my-all">
    The style of this element is reset 
    depending on the all value
  </div>
</div>

Browser support

This table shows when all support started for each browser.

Chrome
37.0 Aug 2014
Firefox
27.0 Feb 2014
IE/Edge
Not supported
Opera
24.0 Sep 2014
Safari
9.1 Mar 2016

You may also like

Guides