This closing lesson of the CSS Debugging module ties the whole module together around what's often the single most common CSS frustration ā a rule that mysteriously isn't applying ā and turns it into a reliably solvable, systematic process.
1The Strikethrough Trail Tells The Complete Story
When you select an element in DevTools, the Styles panel doesn't just show you the one rule that's currently winning ā it lists every rule matching that element, in the order the cascade actually considered them, with any declaration that ultimately lost struck through. This is a direct, complete record of the cascade's reasoning: reading it top to bottom shows exactly which rules were in contention and, implicitly through the strikethrough pattern, exactly which one prevailed.
This single view often immediately resolves the mystery ā if your expected rule appears struck through, you know definitively that it was in contention but lost; if it doesn't appear at all, you know the selector itself never matched the element, a categorically different problem requiring a different fix.
2Stop Manually Counting Specificity ā Check It Directly
Manually calculating specificity (counting IDs, classes, and tag selectors by hand) is error-prone, especially for combined selectors involving multiple classes, attribute selectors, or pseudo-classes stacked together. DevTools removes this manual step entirely ā hovering over or clicking a selector in the Styles panel reveals its exact, calculated specificity value directly, computed by the browser's own actual specificity algorithm, not an approximation.
This is worth treating as the default, first move whenever a specificity question arises, rather than reaching for the mental math from the Organizing CSS or Scalable CSS lessons ā those mental models are essential for *writing* CSS with the right specificity intuitively, but for *debugging* a specific, already-written conflict, the direct DevTools value is faster and immune to manual counting error.
3A Four-Step Elimination Sequence That Rarely Fails
Bringing the whole picture together: First, confirm the selector actually matches the target element at all ā search the Elements tree or check whether your expected rule appears anywhere in the Styles panel, ruling out a simple typo or wrong-element targeting before investigating anything more subtle. Second, if the rule does appear but is struck through, you've confirmed it's a genuine cascade conflict, not an absence ā proceed to compare specificity. Third, hover both the winning and losing selectors to compare their exact specificity values directly, identifying which one actually has higher priority and why. Fourth, if specificity alone doesn't explain the outcome, check for !important on any competing declaration, since it overrides normal specificity entirely regardless of selector strength.
Following this sequence in order ā broadest, most fundamental possible cause first, narrowing down to more specific mechanisms ā resolves the overwhelming majority of 'why isn't this CSS applying' questions reliably and quickly, replacing what used to be trial-and-error CSS changes with a genuine, repeatable diagnostic process.
4Step-by-Step Breakdown
The Most Common CSS Question, Systematically Answered. Every CSS developer has hit this wall: a rule looks correct, but it's simply not applying. This is almost never mysterious once approached systematically ā DevTools shows you exactly which rule won, exactly why, and exactly what specificity math determined it, if you know where to look.
Reading The Strikethrough Trail. The Styles panel doesn't just show the winning rule ā it shows every losing rule too, struck through, in the exact order the cascade considered them. Reading this trail from top to bottom tells the complete story of what was tried and why each attempt lost, before reaching the rule that actually won.
Reading The Strikethrough Trail. What does a struck-through declaration in the DevTools Styles panel tell you?
- āThat the declaration is invalid CSS syntax
- āThat this declaration was overridden by a later or higher-specificity rule and is not the one actually applied
- āThat the property itself is a deprecated CSS feature
Hovering For The Exact Specificity Value. Hovering over (or clicking) a selector in the Styles panel reveals its exact, calculated specificity value as a three-part tuple (IDs, classes, tags) ā replacing manual specificity counting with a direct, authoritative number straight from the browser's own calculation.
Checking Specificity Directly. Why is checking a selector's specificity directly in DevTools more reliable than manually counting it yourself?
- āIt's purely a matter of speed, with no reliability difference
- āIt's the browser's own authoritative calculation, eliminating any risk of manual counting error, especially for complex, combined selectors
- āDevTools uses a fundamentally different specificity system than the actual CSS spec
A Systematic Elimination Process. When a rule mysteriously isn't applying, the reliable sequence is: confirm the selector actually matches the element at all (check for a typo or wrong element), then check the Styles panel for a struck-through version of your rule (confirms it's losing the cascade, not simply absent), then compare specificity values directly, then check for !important anywhere in the competing rules ā each step ruling out a specific category of cause.
The Elimination Sequence. In this debugging sequence, why does 'confirm the selector matches the element at all' come before checking specificity?
- āThe order doesn't actually matter ā any sequence works equally well
- āIf the selector doesn't even match the element (due to a typo or targeting the wrong element), specificity is irrelevant ā checking it first rules out the more fundamental possible cause before investigating a narrower one
- āIt's ordered this way purely for DevTools performance reasons
Cascade Debugging, Systematized. You now approach 'why isn't my CSS applying' as a systematic, reliably solvable process: reading the strikethrough trail for the complete cascade story, checking exact specificity values directly instead of manually counting, and following an ordered elimination sequence that rules out broader causes before narrower ones.
Win With Higher Specificity. An id selector outranks a class selector regardless of source order.
Level Up š
Advanced cheat sheets, SEO tricks, and interview prep for this topic.
Browser Support
Fully supported.
Fully supported.
Fully supported.
Fully supported.
Accessibility (A11y)
1Cascade Debugging Skills Are Especially Valuable For Diagnosing Why An Accessibility Fix Isn't Taking Effect
A common real-world scenario is an accessibility patch (a focus style, a contrast fix) that appears correct in isolation but doesn't actually apply due to a cascade conflict ā this systematic debugging process is directly applicable to resolving exactly that kind of issue quickly.
2Confirming Which Rule Actually Won Prevents Shipping A 'Fix' That Only Appears To Work In Isolated Testing
Verifying via the strikethrough trail that your intended accessibility-related rule is genuinely the one taking effect (not just visually appearing correct by coincidence) avoids a false sense of confidence that a fix is actually deployed correctly.
SEO Implications
- 1
Systematic Cascade Debugging Significantly Reduces Time Spent On One Of The Most Common CSS Debugging Scenarios
Given how frequently 'why isn't my CSS applying' arises in real development, a reliable, fast process for resolving it compounds into meaningful engineering time savings across a project's lifetime.
- 2
Correctly Diagnosing Cascade Conflicts Prevents The Common Anti-Pattern Of Reaching For !important As A First Resort
A developer who can systematically diagnose the actual specificity conflict is far less likely to reach for !important defensively, which as covered in the Organizing CSS lesson, avoids compounding a codebase's long-term specificity management problems.
Best Practices
Always Check Whether Your Expected Rule Appears At All In The Styles Panel Before Investigating Specificity
This single check immediately distinguishes 'the rule is losing a cascade conflict' from 'the selector never matched in the first place', two categorically different problems requiring different fixes.
Use DevTools' Direct Specificity Display Rather Than Manually Counting, Especially For Complex Combined Selectors
It's faster and immune to the manual counting errors that complex, multi-part selectors are genuinely prone to.
Frequent Bugs
A CSS rule looks completely correct but simply doesn't seem to apply at all.
Check the Styles panel to see whether the rule appears struck through (a genuine cascade conflict, investigate specificity) or doesn't appear at all (the selector itself isn't matching, check for a typo or wrong element).
A supposedly higher-specificity rule isn't winning against a simpler-looking one.
Check for !important on the competing declaration ā it overrides normal specificity comparison entirely, which is easy to overlook if you're only comparing selector complexity visually.
Real-World Examples
A Complete Cascade Debugging Session
A developer confused why a .card__title color rule wasn't applying, following the elimination sequence: confirmed the rule appeared in the Styles panel (ruling out a selector mismatch), saw it struck through (confirming a real conflict), compared specificity directly in DevTools, and found a legacy #legacy-card ID selector elsewhere winning by specificity.
/* Found via the elimination sequence: */
#legacy-card .title { color: red; } /* (1,1,0) ā wins */
.card__title { color: blue; } /* (0,1,0) ā loses */