CSS all Property Tutorial

In this section, we will learn what the all property is and how to use it in CSS.

CSS all Property Definition and Usage

The CSS `all` properties are used to reset the values of all properties of an element.

Note: the exception is for unicode-bidi and direction properties.

CSS all Property Syntax

all: initial|inherit|unset;

CSS all Property Value

  • initial: this value means, change the values of the properties to their initial values.
  • inherit: this value means change the values of the properties to inherit from the parent element.
  • unset: This value means, change the values of the properties to inherit from the parent element (if they are inheritable) or to their initial value if they are not inheritable.

Example: all property in CSS

See the Pen all property in CSS by Enjoy Tutorials (@enjoytutorials) on CodePen.

How Does CSS all Property Work?

Even though the background property for this element is set to blue, you won’t see any color for the background. This is because the value of the `all` property in this element is set to “inherit” and so because the parent element (body) doesn’t have any color for its background, this element also followed the same path.

Facebook
Twitter
Pinterest
LinkedIn

Top Technologies