1
HTML/CSSIntermediate#css#cascade
The cascade resolves conflicting rules using, in order: importance (!important beats normal), origin (author styles beat browser defaults), specificity, and finally source order (later rules win ties). Understanding this order prevents 'random' override bugs.
.btn { color: blue; }
.btn { color: red; } /* wins: same specificity, comes later */
.btn { color: green !important; } /* wins over everything except another !important with higher specificity */