First of all, itโs important to apply one specific declaration in the CSS rule. This does not apply to the class. So no, you cannot make a class! Important.
Secondly, only one piece of CSS specificity is important. You can also use other ways to make the rule a more specific rule in order to take precedence (for example, refer to the identifier in the parent chain, and not just the class. When I write CSS, using! Important is my last possible choice - I would rather decide to override other solutions are specific. Usually, if you control all CSS, itโs pretty easy to avoid using it! Important: If you need to override some CSS that you donโt control, sometimes itโs convenient.
Check out this question here for more details. How it explains things better.
source share