Ads by ProfitSence

How to use !important in CSS Code Example

Last Updated on Wednesday 5th Oct 2022
  • The !important keyword is used to override all styles no matter their specificity or position in the stylesheet.


					element {
    font-size: 1.2rem !important;
    font-weight: 500 !important;

  • The !important keyword is the easiest way to ruin the cascade of a stylesheet and make maintaining a stylesheet impossible.


					h2 {
  color: green;

h2 {
  color: blue !important;