← Go Home

Specificity Calculation


CSS specificity is an algorithm that browsers use to determine which CSS declarations apply to an element when multiple, conflicting rules exist. Specificity is just one part of the cascade, but it is often the deciding factor in styling conflicts


The specificity is calculated as a three-column value: (IDs, Classes, Elements).


calculating specificity:


To calculate a selector's specificity, you add points based on the types of selectors it contains. The higher the score, the more specific the selector


Specificity components