Thursday, February 12, 2015

The css !important rule overrides that particular property

p {
    color: red !important;
}
#thing {
    color: green;
}

<p id="thing">Will be RED.</p>

The paragraph will be red, even though the ID selector has higher specificity. The !important rule overrides that particular property.

Reference:

http://css-tricks.com/when-using-important-is-the-right-choice/

No comments: