CSS rule
A selector followed by a block of declarations, such as p { color: red; }, that applies those property values to every matching element.
In more detail
Each declaration is a property and a value. When rules conflict, the cascade compares origin, layer, specificity and source order to choose one value per property.
Related terms
- CSS selector — A pattern, such as .card, #menu or nav a, that picks which elements a CSS rule applies to or which elements a DOM query returns.
- CSS cascade — The CSS process that decides which of several competing rules sets a property on an element.
- CSS — The language that describes how web pages look: colours, fonts, spacing, layout and animation.
Taught in
- CSS Parsing, The CSSOM And The Render Tree — Frontend Architecture & Web Platform
- The Cascade Algorithm: Specificity, Inheritance And Source Order — Frontend Architecture & Web Platform