HTML & CSS · Middle · Question 2 of 75
How do you override a third-party library's !important rule without touching its code?
- 1Write your own rule without
!importantbut with a more specific selector - ✓Correct answer: Write your own rule also with
!importantand a more specific selector - 3You can't:
!importantalways beats any other rule
Explanation
A normal rule never beats !important, however specific it is. Among several !important declarations, specificity and order apply again. Other options: an inline style with !important, or cascade layers - for !important the layer order is reversed. The best path is avoiding !important in your own code.