When multiple rules target the same element, specificity decides which one wins. It's a score computed from the selector's parts, compared as a tuple (ids, classes, elements).
text
Inline style → 1,0,0,0 (highest, short of !important)
ID → 0,1,0,0
Class / attr / pseudo-class → 0,0,1,0
Element / pseudo-element → 0,0,0,1
Universal (*) → 0,0,0,0 (no weight)
Compare left to right; the first column that differs decides the winner.
css
{ : red; }
{ : blue; }
