CSS: In defense of !important

CSS: In defense of !important

6 years ago
Anonymous $L9wC17otzH

https://calidae.blog/css-in-defense-of-important-d82393f81a5

Imagine a situation like this:

div { background-color: blue; font-size: 2em;}div.some-item-whatever { background-color: red;}div#item { background-color: green; font-size: 3em;}This is quite easy to understand. All have a font-size of 2 ems and are blue. Except for the ones with the class some-item-whatever, which are red. Except for the one with an ID of item, which is green and has a bigger text.