Is there ever a situation where using the `!important` flag is advisable?


#1

Question

Is there ever a situation where using the !important flag is advisable?

Answer

As this lesson alludes to, we generally want to avoid using the !important flag as it can lead to time consuming specificity wars. However, one scenario where the !important flag might be advisable is in the case of customizing user style sheets. User style sheets control the way a web browser displays every page a user visits.

For instance, a developer might decide to use the !important flag to customize a browser’s user style sheet such that every page she visited displayed text in a larger font size. In this type of scenario, the !important flag might be used to improve the user experience for the visually impaired.


FAQ: Learn CSS – CSS Setup Selectors – Review CSS Selectors