Claude Code ui

CSS Styles Not Applied, Specificity Issue

A CSS rule was written and is definitely being loaded (visible in dev tools), but it's not applied to elements because a more specific rule is overriding it. This commonly happens after refactoring style organization or adding utility classes.

The style appears in the stylesheet but browsers display the override style instead, confusing developers about what went wrong.

Error Messages You Might See

Style not applied despite being in stylesheet CSS rule crossed out in dev tools (overridden) Unexpected style applied after CSS update
Style not applied despite being in stylesheetCSS rule crossed out in dev tools (overridden)Unexpected style applied after CSS update

Common Causes

  1. Inline styles (style attribute) overriding all CSS rules
  2. !important used in override rule or in original rule creating conflict
  3. Selector specificity too low (element selector beaten by class selector)
  4. CSS order: newer rules loaded after intended rule, causing override
  5. ID selector in override causing extremely high specificity

How to Fix It

Inspect element in dev tools, examine cascade tab to see which rules apply/override. Increase selector specificity without !important if possible. Move your CSS after overriding CSS in load order. Use class selectors instead of element selectors for higher specificity. Avoid inline styles. Reserve !important for utilities only, never for component styles.

Real developers can help you.

hanson1014 hanson1014 Full-stack developer experienced in fixing and deploying AI-generated apps from Lovable, Bolt.new, Cursor, and Replit. I specialize in debugging Supabase integration issues (auth flows, RLS policies, database connections), fixing broken deployments, resolving routing/blank screen problems, and cleaning up messy React/Vite codebases. I also build production apps with the Claude API and have shipped a Mac desktop dev tool (Nexterm from scratch. Based in Hong Kong, fast turnaround. Bastien Labelle Bastien Labelle Full stack dev w/ 20+ years of experience AUXLE AUXLE I am a Full Stack Developer experienced in building Websites, Web apps and Cross Platform Mobile Apps for Startups and Companies. rayush33 rayush33 JavaScript (React.js, React Native, Node.js) Developer with demonstrated industry experience of 4+ years, actively looking for opportunities to hone my skills as well as help small-scale business owners with solutions to technical problems Antriksh Narang Antriksh Narang 5 years+ Experienced Dev (Specially in Web Development), can help in python, javascript, react, next.js and full stack web dev technologies. ISHANTDEEP SINGH ISHANTDEEP SINGH Senior Software Engineer with 7+ years of experience in React, JavaScript, TypeScript, Next.js, and Node.js. I’ve also worked as a tech lead for startups, owning end-to-end technical execution including architecture, development, scaling, and delivery. I bring a strong mix of hands-on coding, product thinking, and technical leadership, and I’m comfortable building products from scratch as well as improving and scaling existing systems. Matthew Butler Matthew Butler Systems Development Engineer @ Amazon Web Services Jen Jacobsen Jen Jacobsen I’m a Full-Stack Developer with over 10 years of experience building modern web and mobile applications. I enjoy working across the full product lifecycle — turning ideas into real, well-built products that are intuitive for users and scalable for businesses. I particularly enjoy building mobile apps, modern web platforms, and solving complex technical problems in a way that keeps systems clean, reliable, and easy to maintain. legrab legrab I'll fill this later Anthony Akpan Anthony Akpan Developer with 8 years of experience building softwares fro startups

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help

Frequently Asked Questions

What's the CSS specificity order?

Inline > ID > Class/Pseudo-class > Element. Newer rules override older rules if same specificity. Use lowest specificity that works.

When should !important be used?

Almost never in component styles. Only use for utility/override classes (e.g., .hidden { display: none !important; }).

How to debug why a style doesn't apply?

Right-click element → Inspect. Look at Styles tab. Crossed-out rules are overridden. Click the rule to see which file it came from.

Related Claude Code Issues

Can't fix it yourself?
Real developers can help.

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help