Why Is My CSS Crossed Out in DevTools? (Fixed)

Why is your CSS crossed out in DevTools? It means another declaration won the cascade — usually higher specificity, sometimes a cascade layer or !important. This fix walks you from the crossed-out line to the winning rule, scores both selectors, and removes the problem without adding !important.

You wrote the rule. You refreshed. Nothing changed. You open DevTools, and there it is — your declaration with a line through it, sitting underneath some other rule that won. Why is your CSS crossed out in DevTools? Because the browser is showing you, in plain sight, that your declaration lost a battle it tells you exactly how to win. A crossed-out line isn't a mystery; it's a scoreboard. Here's how to read it and fix it — without reaching for !important . What the error looks like — why is my CSS crossed out in DevTools Right-click the element, Inspect, and look at the Styles panel. You'll see something like this: /* your stylesheet — style.css:42 */ .card .title { color: #1a1a1a; /* ← struck through: this declaration lost */ } /* the winner — theme.css:18, listed ABOVE yours */ #app .card .title { color: #767676; /* ← this one applies */ } DevTools lists matching rules in cascade order with the winner on top. Your struck-through declaration exists, it's valid, it matches — another declaration simply outranks it. One differential diagnosis before you go further: a line can also be struck through because the value is invalid (DevTools shows a yellow warning triangle — e.g. color: bluish ) or the property doesn't apply to that element (e.g. vertical-align on a block element). No triangle, valid property? Then it's a specificity loss, and the fix below applies. Why it happens Every selector has a score, counted as (IDs, classes, elements). #app .card .title scores (1, 2, 0); .card .title scores (0, 2, 0). Higher score wins, regardless of order — that's why your later rule lost. When scores tie, the later rule in source order wins. Two 2026-era wrinkles catch people out: !important and inline styles beat almost everything, and…

Explore