From the course: CSS: Inheritance, Specificity, and the Cascade

Unlock the full course today

Join today to access over 24,700 courses taught by industry experts.

!important: Its use and abuse

!important: Its use and abuse

- [Instructor] Ah, important. My least favorite development projects are working with someone else's code that's just peppered with bang important declarations. Bang important is used as a last ditch effort, usually, by an inexperienced developer who just wants their style to apply, but has no idea how to make it happen. So let's dive into how bang important fits into the cascade. This is a reminder of what the cascade looks like. Remember that normal styles, that's those without bang important after them, have a different and lower level of importance than the ones with the important on them. They come later in the cascade. Remember that the order of these particular style sheets reverses, so although the author is the most important one in the normal context, it is the least important one when we start throwing around bang importants. And that is because we want our users to be able to override our styles if it's better…

Contents