If you have a CSS rule with !important and another rule with higher specificity targeting the same element, which one will take precedence?

  • Both rules will be applied
  • The order in the stylesheet
  • The rule with !important
  • The rule with higher specificity
If a CSS rule has the !important declaration, it takes the highest precedence, regardless of the specificity of other rules. The !important rule will override any conflicting rule, even if it has a higher specificity.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *