Loading…
A short voice session: one question, one follow-up, then instant feedback — up to 5 minutes.
Within the same cascade origin, importance, and layer context, the more specific selector wins; equally specific rules are resolved by source order.
For ordinary competing rules in the same layer, an id selector outranks a class selector, and a class outranks a type selector. When specificity ties, the later declaration wins. Source order does not automatically beat a more specific selector. The full cascade also considers origin, !important, and cascade layers before specificity, so specificity alone does not explain every conflict.