|
|
|
|
|
by gotchange
3893 days ago
|
|
This where the «!important» flag shines through but it gets a lot of hate in the community but I am seriously not convinced with their reasoning and arguments put forth as they seem not fully aware of the standard order of conflict resolution in dealing with cascading and inheritance in the language. |
|
I'd say it's the other way around - a lot of usages of !important are due to lack of understanding of CSS specificity, usually as a symptom of something else like using IDs in selectors..
If you avoid using IDs in selectors and avoid deep nesting of classes, then overriding styles works as you expect - apply a more specific selector to override the style.
Selector order only comes in to play rarely, and you can structure your files to start with less specific (base) styles first.
I see !important as more of a workaround than a solution, and I don't think it is used as it was originally intended.