Search⌘ K
AI Features

The Cascade and Inheritance

Explore the foundational concepts of CSS cascade and inheritance that determine how styles are applied to HTML elements. Understand how inheritance works at the property level, how to enforce or avoid inheritance with keywords, and how the cascade resolves conflicts, helping you write cleaner and more efficient CSS.

What is the cascade?

The cascade is the “C” in CSS. It’s therefore at the very core of CSS. The cascade algorithm determines the properties applied to page elements.

This determination is based on inheritance, specificity, importance, and rule order. The cascade also ensures that we have no conflicts. If we have multiple CSS rules for the same property and on the same element, the cascade determines which rule is applied.

So, while keeping the cascade in mind, let’s take a look at the rules it uses to make these decisions, ...