The values initial, revert, revert-layer and unset.
Note: These four values can be applied to all properties, including the all
property.
Summary of characteristics of the initial
value
Présentation générale de ces quatre valeurs.
The initial
value.
The value initial
resets a property to its original value, i.e.
before applying all style sheets, including the browser stylesheet.
The initial values are defined in the W3C standard. In principle, they are therefore not browser-dependent.
Initial values are never inherited
.
The revert
value.
The revert
value returns a property to the value set by the browser's internal style sheet.
revert
therefore overrides the effect of any CSS rules defined by the developer on this property.
revert
can return the inherited
value while initial
cannot.
The revert-layer
value.
revert-layer
undoes any changes made to the value of the property in that same cascade layer.
Changes made in another cascade layer remain valid.
For a more detailed explanation of cascade layers, refer to this tutorial at cascading layers.
The unset
value.
The unset
value resets the property to the initial value unless the browser style sheet sets
the value inherits
. In this case, unset
retrieves the inherit
value.
Comparing the behavior of initial
, revert
, and unset
values.
The behavior of these three values can also be schematized by the following table:
initial |
revert |
unset |
||
Values defined by the developer's stylesheet. |
![]() |
![]() |
![]() |
![]() |
Values set by the browser stylesheet. |
inherit |
Value | ||
Initial values (defined by the W3C). |
initial |
initial |
initial |
initial |
Examples.
Example 1.
The example shows how the three values initial
, revert
, and unset
behave on a property
set to the value inherited
by the browser. We chose the font-size
property.
The texts in this block have a size set to small
.
No change in font size.
Here's a link whose font-size
property
has not been changed: its value is therefore defined by the browser's internal style sheet, either for this property,
the value inherit
.
The characters in the link are effectively the same size as those in the parent (the paragraph in which the link is included).
Applying the initial
value.
This link has its font-size
property set to the initial
value.
We can see that the characters in the link have not recovered the size of the paragraph text. Indeed, the initial value of font-size
is medium
.
Applying the value revert
.
The font-size
property of this link has been set to revert
.
The value set by the browser's style sheet is therefore rendered, i.e., for this property, it is the value inherits
.
Applying the value unset
.
The font-size
property of this link has been set to unset
.
Since the browser style sheet sets the inherit
value for this property, it is this value that
is retrieved by unset
.
Example 2.
This second example shows how the three values initial
, revert
, and unset
behave on a property
that the browser does not set to inherit
. We chose the background-color
property.
For the background-color
property we see that the three predefined values finally return the same value:
the initial value which is transparent
.
#ffff1c
. Note: Overflowing the internal blocks allows you to distinguish the background color of the parent's background color.
Applying the value initial
.
The background color has been set to initial
.
Applying the value revert
.
The value revert
has been applied to the background-color
property.
We should therefore retrieve the value defined by the browser in its internal style sheet, but the browser does not define
nothing: we therefore return to the initial value.
Applying the value unset
.
The background color has been set to unset
. As long as the browser has not forced this
value to inherit
, it is the initial value that is retrieved, i.e. transparent
.
Browser support (compatibility).
The four values initial
, revert
, unset
, and revert-layer
are well recognized by browsers.
initial
value
revert
value
revert-layer
value
unset
value
Browsers on computers :
Mobile browsers :
Outdated or marginal browsers :

Internet Explorer

QQ Browser

Safari sur IOS

Firefox pour Androïd

Opéra Mobile

Baidu Browser

KaiOS Browser

UC Browser pour Androïd

Opéra

Safari

Firefox

Chrome pour Androïd

Samsung Internet

Chrome

Edge

Androïd Brower

Opéra mini
Values history initial
.
-
Cascading Style Sheets specification - Version 1
Setting theinitial
value in the very first version of CSS.November 17, 1995Working Draft.November 12, 1996Proposed for recommendation.December 17, 1996Recommendation .September 13, 2018Old specification, declared obsolete. -
Cascading Style Sheets Level 2 - Revision 1 Specification
No change to theinitial
value.November 04, 1997Working Draft.March 24, 1998Proposed for recommendation.May 11, 1998Recommendation . -
CSS Cascading and Inheritance Level 3
Introducing theunset
value.July 13, 2001Working Draft.October 03, 2013Candidate Recommendation.December 22, 2020Proposed for recommendation.February 11, 2021Recommendation . -
CSS Cascading and Inheritance Level 4
Introducing therevert
value.April 21, 2015Working Draft.January 14, 2016Candidate Recommendation. -
CSS Cascading and Inheritance Level 5
Introducing therevert-layer
value.January 19, 2021Working Draft.January 13, 2022Candidate Recommendation.
See also, about values.
The CSS specifications published by the W3C are organized into modules.
The values initial
, revert
, revert-layer
, and unset
are part of the CSS Cascading and Inheritance module.
The following definitions are also described in this same module.
Properties:
At-rules:

