!important
A flag added to a CSS declaration that moves it into a higher-priority group of the cascade, above all normal declarations.
In more detail
Overusing it leads to escalating battles. With cascade layers the order of important declarations is reversed: an important rule in an early layer such as a reset beats important rules in later layers, which lets base layers enforce accessibility minimums.
Related terms
- CSS cascade — The CSS process that decides which of several competing rules sets a property on an element.
- cascade layer — A named group of CSS rules, declared with @layer, whose priority in the cascade is set by layer order instead of selector specificity.
- specificity — The weight the browser gives a CSS selector, used to decide which rule wins when two set the same property.
Taught in
- The Cascade Algorithm: Specificity, Inheritance And Source Order — Frontend Architecture & Web Platform
- CSS Cascade Layers: Taming Specificity Wars with @layer — Frontend Architecture & Web Platform