Start a project

Tool 51 of 194 · CSS

CSS Cascade Conflict Resolver

Pick an element and see each property's winning value, every declaration it beat, and the exact cascade step that decided it: importance, layers, specificity or order.

CSS Cascade Conflict Resolver at a glanceIllustration: 1, HTML and CSS; 2, processed in your browser; 3, Winner explained.CSS Cascade Conflict Resolver</>1HTML and CSS3Winner explained2In yourbrowser
1 HTML and CSS 2 processed on your device 3 Winner explained

CSS Cascade Conflict Resolver

Your HTML and CSS

    What wins, and why

    PropertyValueFromWhy it wins

    Every competing declaration

    Green wins, red is overridden, blue doesn't apply right now.

    PropertyValueSelectorLayerSpecificityLineStatus

    Layer order

      Contested properties

      01

      What it does

      Ranks every CSS declaration that targets an element the way the cascade does, and says in plain words why the winner wins.

      • Cascade Level 5 order: importance, inline styles, @layer, specificity, source order
      • Layer order from statements, blocks, nested and anonymous layers, reversed for !important
      • CSS nesting resolved (& and relative selectors)
      • @media evaluated for a viewport width and colour scheme; @supports by your browser

      02

      Private by design

      Everything happens in your browser. Nothing you type, paste or upload is sent anywhere, and it keeps working offline once the page has loaded.

      03

      What you get

      Winning values with reasons, every competing declaration, layer order and inherited values, with a Copy and a Download button on every result.

      • CSS
      • Cascade
      • Specificity
      • @layer
      • Debugging

      Why it matters

      "Why isn't my style applied?" is the most common CSS question, and DevTools only half answers it: it strikes through the losing declaration but doesn't say whether it lost on specificity, on a layer, to an !important somewhere else, or because its media query isn't matching. Cascade layers made this harder: a one-class selector in a later layer now beats an ID in an earlier one, and !important flips the layer order.

      This resolver parses your CSS with its layers, nesting, @media and @supports, matches every rule against the element you pick in an inert copy of your HTML, and ranks the declarations for each property in the order the CSS Cascading and Inheritance Level 5 spec gives. For every winner it names the step that decided it, such as "unlayered styles beat any layer" or "specificity (1,0,0) beats (0,2,0)"; for every loser it says what beat it; and declarations that don't apply right now, behind a media query, a :hover or a ::before, are listed with the reason. Inherited properties like color and font-family are traced to the ancestor that set them.

      How it works

      1. InputAn element and the CSS that targets it
      2. In your browserRanked by importance, layers, specificity and order
      3. OutputEach property's winner and why

      Where it fits in a designer's workflow

      1. Plan
      2. Design
      3. Build
      4. Test
      5. Launch
      Debugging a style that won't apply.

      By the numbers

      Declarations competing for each property of the sample's Buy buttonbackground: 4 declarations; #buy wins; color: 3 declarations; .btn-primary wins; margin-top: 2 declarations; .card .btn wins; padding: 4 declarations; .featured .btn winsbackground4 declarations; #buy winscolor3 declarations; .btn-primary winsmargin-top2 declarations; .card .btn winspadding4 declarations; .featured .btn wins
      Computed by this tool from its sample at 1280px: the ID rule #buy wins background because it's unlayered, not because of its ID, and a !important colour in the components layer beats an unlayered rule with higher specificity. The mobile padding loses only because its media query is false at this width. Source: W3C: CSS Cascading and Inheritance Level 5; MDN: Cascade layers.
      Show the numbers as a table
      PropertyDeclarationsWinnerWhy
      background4#buyUnlayered styles beat any layer, here components.
      color3.btn-primary!important beats normal declarations.
      margin-top2.card .btnLayer components comes after reset in the layer order.
      padding4.featured .btnUnlayered styles beat any layer, here components.

      How to use it

      1. Paste the HTML and CSS.
      2. Pick the element that looks wrong (the one with most overridden declarations is picked first).
      3. Set the viewport width and colour scheme to match.
      4. Read why each value wins, and what it beat.

      FAQ

      What order does the cascade use?

      First importance (!important beats normal), then inline style attributes over stylesheet rules, then cascade layers, then specificity, then whichever comes last in the source. Each step only matters if the earlier ones tie.

      How do @layer rules change things?

      Layers are ordered by when their names first appear. For normal declarations, later layers win and unlayered CSS beats every layer, whatever the specificity. For !important it's reversed: the earliest layer wins.

      Why does a selector with an ID lose?

      Usually because it's inside an earlier layer, or the other declaration is !important or inline. Specificity only compares declarations in the same layer and importance.

      Does it handle nested CSS?

      Yes. Nested rules are resolved as the spec says: & becomes the parent selector wrapped in :is(), and relative selectors become descendants, so specificity matches the browser.

      What can't it see?

      Styles added by JavaScript, the browser's default stylesheet, @scope proximity and container query sizes (container queries are assumed to match and marked).

      Work with me

      Want a site that gets these right?

      I build fast, accessible websites and web apps that pass these checks from day one. Tell me about your project and I'll reply personally with honest next steps.

      All developer tools · Back to leej.uk