The <!important> declaration is one of the most powerful tools in CSS, as it overrides specificity rules. While it can be useful when no other solution is possible, its use carries risks.
The <!important> is a special mark that makes a property value the highest priority. The browser will apply it even if another rule has higher specificity.
The following example shows how to override a paragraph’s color using <!important>.
The <!important> declaration should be used when there is no other way to enforce a rule, such as when overriding styles from a third-party stylesheet. Excessive use, however, makes maintenance difficult.
Too many !important declarations can break the stylesheet because it becomes difficult to understand why a rule applies. This often forces you to add even more !important declarations, leading to chaos.
Instead of !important, it is better to rely on CSS specificity rules: use more precise selectors, understand the cascade (inheritance), or place styles in the correct order.
The following example shows how to avoid using !important by relying on specificity:
Here are some practical tips on when and how to use <!important> safely:
Please sign in to ask Lara about CSS !important.
Select Language
Set theme
© 2025 ReadyTools. All rights reserved.