The reason it works is because it's a declaration purposely created to weigh in as most specific. It was meant to balance user styles especially for #a11y and author styles that try to steal the weight of a user sheet. It's a cheat and if folks do it they are not mastering code.
Replying to @mholzschlag
I just use !important in every declaration. Works like magic. jk - don't punch me!
1
3
I know you were j/k but I used your quip as a bouncing off point for addressing a very !important issue ;-)
1
1
Yes, I got that -- and I'm glad! I handed a colleague a fix yesterday for her WordPress/page builder site, to override some plugin default color combos, and on the bad side the CSS I passed her included !important. On the good side it was to get to a decent contrast level.
1
1
Replying to @accessamy
such a great example of real-world immediate needs over long-term for a necessary outcome in the time crunches we have. Sometimes it is a matter of making the choice, and if it can be defended well, sometimes rule breaking brings solutions. But KNOWING why when and how? Tricky!

Jan 24, 2019 路 7:35 PM UTC

1