Instantly calculate the specificity of any CSS selector. Compare two selectors to see which wins. Free, client-side, no signup.
Enter a CSS selector above to see its specificity.
style="" attribute on an element. Highest specificity weight.#myId — each ID adds 1 to column B. IDs must be unique per page..class, [attr], :hover, :nth-child() — each adds 1 to column C.div, span, ::before, ::after — each adds 1 to column D.Specificity is compared column by column from left (A) to right (D). A higher value in column A always beats any value in B, C, or D — there is no overflow. The universal selector * and combinators (>, +, ~) contribute zero specificity.
Note: !important overrides all specificity but is not a selector — it's not counted here.