# Specificity

*noun*

say it: **“spes-ih-FIS-ih-tee”** **/ˌspɛsɪˈfɪsɪti/**

A score the browser gives every selector, counting ids, then classes, attributes and pseudo-classes, then element names. When rules clash, the higher score wins.

## What is **specificity**?

**Specificity** is how precise a selector is. When rules clash, the more specific one wins: an id beats a class, and a class beats a tag name.

```css
p { color: black; }
.intro { color: blue; }   /* wins over p: a class is more specific */
```

## In a sentence

- “My .price rule lost because .product .price has higher **specificity**, even though mine came last.”

Level: Novice · [More CSS terms at this level](https://www.ask-codey.com/glossary?category=css&level=1)

Updated: November 9, 2026

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