CSS Specificity Visualizer
Visualize CSS selector specificity scores (ID, Class, Element).
HTML Link & Heading Extractor
About CSS Specificity Visualizer
The CSS Specificity Calculator & Conflict Visualizer calculates exact 4-part specificity scores (`Inline, IDs, Classes/Attributes/Pseudo-classes, Elements/Pseudo-elements`) for CSS selectors, comparing rules to explain cascading priority and override conflicts.
How to Use CSS Specificity Visualizer
Step 1
Type or paste one or more CSS selectors.
Step 2
Inspect the specificity score badge and breakdown table.
Step 3
Compare competing selectors to see the winning rule.
Step 4
Click "Copy Specificity Report".
Practical Use Cases for CSS Specificity Visualizer
Debugging Why CSS Styles Are Not Applying
Compare competing CSS selectors (e.g. `#nav .item:hover` vs `header ul.menu li a`) to see why one rule overrides another in the cascade.
Refactoring Over-Specific CSS Selectors
Identify high-specificity selectors that force developers to use `!important`, and simplify them into maintainable class-based architectures.
Input & Output Examples
Calculating Specificity for Complex Selector
`#main-header nav ul.menu > li.active a:hover`
Score: `(0, 1, 3, 3)` | Breakdown: 1 ID (`#main-header`), 3 Classes/Pseudo-classes (`.menu`, `.active`, `:hover`), 3 Elements (`nav`, `ul`, `li`, `a`)
Key Features & Performance
- ✓Calculates formal W3C Specificity Tuple: `(Inline, ID, Class, Type)`.
- ✓Side-by-side selector comparison: visually highlights which selector wins the cascade.
- ✓Supports modern CSS Selectors Level 4: `:is()`, `:where()` (0 specificity), `:not()`, `:has()`, and `@layer`.
- ✓100% Client-Side memory execution.
- ✓1-Click Copy specificity breakdown.
Key Terminology & Definitions
Specificity (CSS Cascade)
The algorithmic weight assigned to a CSS selector determining which style rule browsers apply when multiple rules match the same element.
`:where()` Pseudo-Class
A CSS pseudo-class function that matches elements while always having a specificity score of zero `(0, 0, 0, 0)`.
