Visual CSS Specificity Calculator - Online (0,0,1) Style
Enter a CSS selector and see its specificity broken down into A,B,C columns with a visual weight comparison. Learn specificity.
UD5 Toolkit
Compare two CSS selectors side by side and see which one wins based on specificity weight. Understand how ID, class, attribute, and element selectors stack up.
Quick Presets — Click to load
Specificity is expressed as four values: (a, b, c, d) —
a: inline styles (always 0 for selectors),
b: ID selectors,
c: classes / attributes / pseudo-classes,
d: elements / pseudo-elements.
Comparison is left-to-right: higher b wins; if equal, higher c wins, and so on.
:not(), :is(), and :has() take the highest specificity from their arguments,
while :where() always contributes zero.
#header)..menu), attribute selectors ([type="text"]), and pseudo-classes (:hover, :nth-child()).div, p) and pseudo-elements (::before, ::after).*, combinators (>, +, ~, space), and :where() contribute nothing. Compare columns left to right: the first higher value wins.
:not() — Takes the specificity of the most specific selector inside its parentheses. :not(.foo, #bar) has specificity (0,1,0,0) because #bar is an ID.:is() — Same as :not(): uses the highest specificity among its arguments.:has() — Also takes the highest specificity from its arguments (the "specificity of its most specific argument").:where() — Always has zero specificity (0,0,0,0), making it perfect for creating low-specificity base styles that are easy to override.
#my-id) contributes to column b (0,1,0,0), while a class selector (.my-class) contributes to column c (0,0,1,0). Because comparison is left-to-right, a single ID will always beat any number of classes. For example, #header (0,1,0,0) overrides .a.b.c.d.e.f.g.h.i.j (0,0,10,0), no matter how many classes are chained. This is why many modern CSS methodologies recommend avoiding IDs for styling and using classes exclusively.
* contributes zero specificity (0,0,0,0). It matches any element but doesn't add weight. For instance, *.warning has exactly the same specificity as .warning — both are (0,0,1,0). Similarly, combinators like > (child), + (adjacent sibling), ~ (general sibling), and the space (descendant) also add zero specificity.
:where() is useful — it lets you write styles that are intentionally easy to override later.
!important doesn't change specificity — it bypasses the normal cascade entirely. An !important declaration in a rule with low specificity will still beat a normal declaration with high specificity. However, !important is considered a last resort and should be used sparingly, as it makes stylesheets harder to debug and maintain. When two !important declarations conflict, specificity is used to break the tie. Overusing !important often indicates specificity wars in a codebase that should be resolved by refactoring selectors.
!important. Modern CSS best practices (including methodologies like BEM, SMACSS, and OOCSS) recommend using classes exclusively for styling. Reserve IDs for JavaScript hooks (document.getElementById) and fragment anchors. This keeps specificity flat and manageable throughout your project.
Enter a CSS selector and see its specificity broken down into A,B,C columns with a visual weight comparison. Learn specificity.
Design a layout where nested grids share track sizes with their parent via subgrid. Copy the complete CSS.
Create a pure CSS scroll progress indicator using animation‑timeline: scroll(). No JavaScript. Copy the complete code.
Paste your CSS and see warnings for properties that have limited browser support. Links to CanIUse. Modernize safely.
Limit browser gestures on an element: pan‑x, pinch‑zoom, manipulation. Draw on a canvas to test. Mobile dev helper.
Create complex linear gradients with any number of color stops, exact angles, and length units. Live preview and CSS code.
Style underlines, overlines, and strike-throughs with colors, wavy styles, and thickness. Modern CSS text‑decoration.
Design a button or card that glows on hover. Adjust shadow color, spread, and transition. Copy the CSS. Rich UI.
Create a realistic letterpress (debossed) text effect using CSS text‑shadow and background. Adjust depth and light direction. Copy code.
Paste your CSS and sort the properties of each rule alphabetically or by concentric groups. Keep your stylesheets consistent without a build step.
Generate a subtle noise/grain texture as a CSS background pattern. Adjust opacity and size. For that film look.
Create a customizable checkerboard or grid background using pure CSS gradients. Adjust cell size and colors. Copy the code.
Upload two images and apply CSS blend modes (multiply, screen, overlay, etc.). See the result and copy the filter CSS. Pure frontend.
Add print styles like removing backgrounds, adding page breaks, setting margins. See print preview instantly.
Create a pure CSS countdown timer with a flipping number effect. Adjust duration and style. No JavaScript needed for display.
Paste HTML/CSS snippets or enter properties to test how z‑index and stacking contexts interact. Real‑time example.
Create a glowing or rotating border animation around an element. Copy the CSS keyframes. Pure CSS magic.
Create a custom HTML/CSS progress bar with percentage, colors, and animation. Copy the code. Modern UI element.
Paste two versions of the same idea and see a word‑level diff highlighting the rewrite. Not AI, just diff.
Design a realistic neon sign text with multiple layers of glow. Copy the CSS and HTML. Perfect for headers.
A replica of the famous Flexbox Froggy game: solve alignment puzzles by writing CSS. Progress saved locally. Fun frontend learning.
Fetch a website's CSS and extract :root custom properties (‑‑color) to reveal its design token palette. For learning and inspiration.
Paste two texts, compute the diff, and render the result as a highlighted image. Easier to share changes visually.
Recreate the target CSS linear gradient by adjusting stops and colors. A unique game for front‑end developers to master gradients.
Browse and search all Font Awesome 6 icons with preview, class name, and unicode. Copy the HTML snippet. Perfect for web developers.
Create text with a gradient fill using CSS background-clip. Configure colors and direction. Copy the code. Works in modern browsers.
A complete, searchable list of all 140+ named HTML/CSS colors with their hex codes and color previews. Click to copy code. Essential web reference.
Visually experiment with Flexbox container and item properties. See the layout update in real time and copy the CSS. Learn by doing, fully interactive.
Minify JavaScript and CSS code to reduce file size for production. Remove whitespace and comments instantly. Run locally, your code stays private.
Easily create asymmetric border radius values and preview the result. Copy the generated CSS instantly. All interactively and browser-based.