Technical

Critical CSS

The minimal set of CSS rules required to render above-the-fold content, inlined directly in the HTML document to eliminate render-blocking stylesheet requests.

Quick Answer

  • What it is: The minimal set of CSS rules required to render above-the-fold content, inlined directly in the HTML document to eliminate render-blocking stylesheet requests.
  • Why it matters: Critical CSS eliminates the render-blocking delay caused by external stylesheets, directly improving First Contentful Paint and Largest Contentful Paint scores.
  • How to check or improve: Extract the CSS needed for above-the-fold content, inline it in a style tag in the head, and defer loading of the remaining stylesheet.

When you'd use this

Critical CSS eliminates the render-blocking delay caused by external stylesheets, directly improving First Contentful Paint and Largest Contentful Paint scores.

Example scenario

Hypothetical scenario (not a real company)

A team might use Critical CSS when Extract the CSS needed for above-the-fold content, inline it in a style tag in the head, and defer loading of the remaining stylesheet.

Common mistakes

  • Confusing Critical CSS with Render-Blocking Resources: CSS and JavaScript files that prevent the browser from rendering page content until they're fully downloaded and processed, significantly impacting page load performance.
  • Confusing Critical CSS with Core Web Vitals: A set of three specific metrics that Google uses to measure user experience on websites: loading performance (LCP), interactivity (INP), and visual stability (CLS). Learn how to measure and improve your Core Web Vitals scores.
  • Confusing Critical CSS with First Contentful Paint (FCP): A performance metric that measures the time from when a page starts loading to when any part of the page's content is rendered on the screen.

How to measure or implement

  • Extract the CSS needed for above-the-fold content, inline it in a style tag in the head, and defer loading of the remaining stylesheet

Check your site's visibility with Rankwise

Start here
Updated Mar 12, 2026·7 min read

What is Critical CSS?

Critical CSS (also called above-the-fold CSS) is the minimum set of CSS rules required to render the content a user sees on initial page load without scrolling. Instead of forcing the browser to download an entire external stylesheet before displaying anything, you inline this critical subset directly in the HTML document's <head> section. The remaining CSS loads asynchronously after the page has rendered.

When a browser encounters an external stylesheet link, it must download and parse the entire file before rendering any content. For a typical site with a 100-200KB stylesheet, this adds 200-500ms of render-blocking time on mobile connections. Critical CSS eliminates this bottleneck by giving the browser everything it needs to paint the first viewport immediately.

Why This Matters

Critical CSS is one of the highest-impact performance optimizations you can make. It directly affects the metrics Google uses for ranking:

Performance impact:

MetricWithout Critical CSSWith Critical CSSImprovement
First Contentful Paint1.8-3.5s0.8-1.5s40-60% faster
Largest Contentful Paint2.5-5.0s1.2-2.5s30-50% faster
Time to InteractiveDelayed by CSS parsingImprovedSignificant

Why search engines care:

  • Core Web Vitals are a confirmed Google ranking signal. FCP and LCP both improve dramatically with critical CSS.
  • Faster rendering reduces bounce rates. Each additional second of load time increases bounce probability by 32%.
  • Mobile users on 3G/4G connections benefit the most, and Google uses mobile performance for ranking decisions.

Why AI search cares:

AI crawlers also benefit from faster page delivery. Pages that render quickly and deliver structured content efficiently are more reliably processed during indexing.

How Critical CSS Works

The Render-Blocking Problem

Without critical CSS, the browser rendering sequence looks like this:

  1. Browser receives HTML
  2. Browser encounters <link rel="stylesheet" href="styles.css">
  3. Browser pauses rendering and downloads the full stylesheet (100-200KB)
  4. Browser parses the CSS
  5. Browser can finally render the page

The user sees a blank screen during steps 2-4.

The Critical CSS Solution

With critical CSS, the sequence changes:

  1. Browser receives HTML with critical CSS inlined in <style> tags
  2. Browser immediately renders above-the-fold content using inlined styles
  3. Full stylesheet loads asynchronously in the background
  4. Once loaded, remaining styles apply to below-the-fold content

The user sees styled content almost immediately.

What Belongs in Critical CSS

Critical CSS should include only the rules needed for above-the-fold rendering:

  • Include: Layout rules (grid, flexbox), typography for visible text, header/navigation styles, hero section styles, background colors and images visible in the first viewport
  • Exclude: Below-the-fold component styles, hover/focus states for elements not in the first viewport, print stylesheets, animation keyframes that trigger later, styles for elements loaded via JavaScript

A well-extracted critical CSS payload is typically 10-30KB — small enough to inline without significantly increasing HTML document size.

How to Implement Critical CSS

Method 1: Automated Extraction Tools

The most reliable approach is automated extraction. These tools render your page in a headless browser, determine which CSS rules affect the above-the-fold viewport, and output only those rules.

Popular tools:

  • Critical (by Addy Osmani): Node.js module that extracts and inlines critical CSS as part of your build process
  • Penthouse: Generates critical CSS by rendering pages in a headless Chrome instance
  • Critters (by Google): Webpack plugin that inlines critical CSS at build time

Build integration example with Critical:

const critical = require("critical")

critical.generate({
  base: "dist/",
  src: "index.html",
  css: ["dist/styles.css"],
  width: 1300,
  height: 900,
  inline: true,
  target: {
    html: "index-critical.html",
    uncritical: "non-critical.css"
  }
})

Method 2: Manual Extraction

For small sites or single landing pages, manual extraction is viable:

  1. Open Chrome DevTools and go to the Coverage tab
  2. Load your page and identify which CSS rules are used above the fold
  3. Copy those rules into a <style> block in your HTML head
  4. Defer the full stylesheet

This approach does not scale but gives you fine-grained control.

Method 3: Framework-Specific Solutions

  • Next.js: Automatically inlines critical CSS when using CSS Modules or styled-jsx
  • Nuxt.js: Use the @nuxtjs/critical module
  • WordPress: Plugins like WP Rocket or Autoptimize handle critical CSS extraction
  • Gatsby: Inlines critical CSS by default during static generation

Deferring the Remaining CSS

After inlining critical CSS, load the full stylesheet without blocking rendering:

<head>
  <!-- Critical CSS inlined -->
  <style>
    /* above-the-fold styles here */
  </style>

  <!-- Full stylesheet loaded asynchronously -->
  <link
    rel="preload"
    href="styles.css"
    as="style"
    onload="this.onload=null;this.rel='stylesheet'"
  />
  <noscript>
    <link rel="stylesheet" href="styles.css" />
  </noscript>
</head>

The preload pattern tells the browser to fetch the stylesheet at high priority but not block rendering. The onload handler switches it to a regular stylesheet once downloaded. The noscript fallback ensures the stylesheet loads even without JavaScript.

Common Mistakes

  • Inlining too much CSS: If your inlined CSS exceeds 50KB, you are including non-critical rules that increase HTML size without improving render speed. Keep it under 30KB.
  • Not deferring the full stylesheet: Inlining critical CSS is only half the optimization. If the full stylesheet still loads synchronously, you have added weight without removing the blocking behavior.
  • Using a fixed critical CSS across all page types: Your homepage, product pages, and blog posts have different above-the-fold content. Extract critical CSS per template, not per site.
  • Forgetting to regenerate after CSS changes: When you update your stylesheets, the critical CSS extract becomes stale. Integrate extraction into your build pipeline so it runs automatically.
  • Ignoring mobile viewports: Critical CSS varies by viewport width. Extract for both mobile (360px) and desktop (1300px) viewports, or use a responsive approach that covers both.
  • Flash of unstyled content (FOUC): If critical CSS is incomplete, below-the-fold elements briefly appear unstyled as the full stylesheet loads. Test thoroughly on slow connections.

Testing and Validation

Verify Critical CSS is Working

  1. Open Chrome DevTools, go to Network tab, and enable "Disable cache"
  2. Throttle to "Slow 3G" to simulate constrained connections
  3. Reload the page and observe the first paint — above-the-fold content should render styled before the full stylesheet finishes loading
  4. Check the Coverage tab to confirm inlined CSS matches what is used above the fold

Performance Benchmarks

After implementing critical CSS, validate improvements:

  • Run PageSpeed Insights and compare FCP/LCP scores before and after
  • Check Core Web Vitals in Google Search Console (field data updates over 28 days)
  • Test on real mobile devices, not just emulators

Practical Examples

Example 1: An e-commerce site with a 180KB stylesheet implements critical CSS extraction per page template (homepage, category page, product page). FCP drops from 2.8s to 1.1s on mobile. LCP improves by 40%. The site passes Core Web Vitals assessment within one CrUX reporting cycle.

Example 2: A blog running WordPress adds the WP Rocket plugin and enables critical CSS generation. Without touching any code, FCP improves from 3.2s to 1.4s. However, the generic extraction misses some above-the-fold layout rules, causing a brief FOUC on long-form article pages. The team adds a custom critical CSS override for the article template to resolve it.

FAQs

Does critical CSS help with SEO?

Yes, directly. Critical CSS improves First Contentful Paint and Largest Contentful Paint, both Core Web Vitals metrics that Google uses as ranking signals. The impact is most significant on mobile, which is what Google uses for indexing.

How much critical CSS is too much?

Keep inlined critical CSS under 30KB (ideally under 15KB). Above 50KB, the increased HTML document size starts to offset the gains from eliminating render blocking. If your critical CSS is large, you likely have an overly complex above-the-fold design.

Does critical CSS work with CSS-in-JS?

Yes, but the approach differs. Frameworks like styled-components and Emotion can extract critical CSS during server-side rendering and inline it automatically. Next.js handles this natively with its CSS module support.

Should I use critical CSS with HTTP/2?

Yes. While HTTP/2 multiplexing reduces the overhead of multiple requests, it does not eliminate render blocking. The browser still must download and parse external CSS before rendering, regardless of the protocol. Critical CSS remains beneficial.

How often should I regenerate critical CSS?

Every time you change your CSS or page templates. The best practice is to integrate critical CSS extraction into your CI/CD pipeline so it regenerates automatically on every deploy.

  • Guide: /resources/guides/internal-linking-best-practices
  • Template: /templates/checklist-template
  • Use case: /use-cases/saas-companies
  • Glossary:
    • /glossary/render-blocking-resources
    • /glossary/core-web-vitals
    • /glossary/first-contentful-paint
    • /glossary/css-optimization

Put GEO into practice

Generate AI-optimized content that gets cited.

Try Rankwise Free
Newsletter

Stay ahead of AI search

Weekly insights on GEO and content optimization.