codegurukool.com · Free coding tutorials & online compiler

Home › CSS Tutorial › CSS !important

CSS !important

Override everything, sparingly.

!important beats normal specificity. It makes code hard to maintain, so use it only for utility overrides.

Example code

<style>
#a{color:blue}p{color:orange!important}
</style>
<p id='a'>Orange despite the id</p>

Run this code in the online editor

← CSS specificityCSS math functions →