What does !important do in CSS?
Adding !important after a value makes that declaration win against all normal declarations, even inline styles. Only another !important with a higher specificity can beat it.
p { color: blue !important; }
Avoid it. It breaks the normal cascade and makes the code hard to fix. It is acceptable for small utility classes (like .hidden) or to override styles of a library you cannot edit. See CSS Specificity.
Learn more about the similar topics:
| Tutorials |
|---|
| CSS Selectors |
| CSS Specificity |
| CSS Pseudo-classes and Pseudo-elements |
| Exercises & Assignments |
|---|
| No Content Found. |