Skip to main content

CSS cascade and inheritance

The CSS cascade and inheritance module defines the rules for assigning values to properties by way of cascading and inheritance. This module specifies the rules for finding the specified value for all properties on all elements.

One of the fundamental design principles of CSS is cascading of rules. It allows several style sheets to influence the presentation of a document. CSS property-value declarations define how a document is rendered. Multiple declarations may set different values for the same element and property combination, but only one value can be applied to any CSS property. The CSS cascade module defines how these conflicts are resolved.

The opposite also occurs. Sometimes there are no declarations defining the value of a property. The CSS cascade module defines how these missing values should be set via inheritance or from the property's initial value.

[!NOTE] The rules for finding the specified values in the page context and its margin boxes are described in the CSS page module.

Reference

Properties

  • {{cssxref("all")}}

At-rules

  • {{cssxref("@import")}}
  • {{cssxref("@layer")}}

Keywords

  • {{cssxref("initial")}}
  • {{cssxref("inherit")}}
  • {{cssxref("revert")}}
  • {{cssxref("revert-layer")}}
  • {{cssxref("unset")}}
  • {{cssxref("important", "!important")}} flag

Interfaces

  • {{DOMXRef("CSSLayerBlockRule")}}
  • {{DOMXRef("CSSGroupingRule")}}
  • {{DOMXRef("CSSLayerStatementRule")}}
  • {{DOMXRef("CSSRule")}}

Key concepts and definitions

Guides

Specifications

See also