1
CSS specificity assigns a weight or point value to different selectors to determine which style rule gets applied when conflicts arise.
2
Element selectors have the lowest point value. When selectors have equal point values, the rule that appears last in the cascading style sheet wins.
3
Combining selectors (such as descendants or adding classes and IDs) increases the total point value, making the selector more specific.
4
IDs carry a higher point value than classes and attributes, while classes and attributes carry a higher point value than element selectors.
5
Inline styles applied directly in the HTML markup carry the highest specificity weight among standard selectors.
6
The !important rule overrides all normal specificity calculations and inline styles, but it should be used sparingly to avoid debugging difficulties.