# Specificity calculation

Count ids, then classes, then tags; compare left to right.

## How is **specificity** worked out?

Specificity is counted in three columns: ids, then classes/attributes/pseudo-classes, then tag names. Compare left to right; the first bigger number wins.

```css
#nav .item a    /* 1 id, 1 class, 1 tag  = (1,1,1) */
.nav .item a    /* 0 ids, 2 classes, 1 tag = (0,2,1): loses */
```

Level: Freelancer · [More CSS terms at this level](https://www.ask-codey.com/glossary/subjects/css/freelancer)

Updated: September 27, 2026

Source: https://www.ask-codey.com/glossary/specificity-calculation
