Overwriting specificity in CSS

written by Dariush 5 months ago

To overwrite specificity in your css style sheet you can declare it as follows:

h1 {background: green !important;}

The important above overwrites the specificity in the entire style sheet. It can be a good debugging tool to figure out where else we have a style declared that conflicts with this one.

Make sure not to leave the !important in there in the production mode.

Post a comment

Options:

Size

Colors