---
title: "Put the styles in the page · Agent Wranglers"
url: https://agentwranglers.se/playbook/website/performance/critical-css
updated: 2026-10-20
licence: "All rights reserved"
---

# Put the styles in the page

By Erik Bergstedt, Agent Wranglers. Updated 2026-10-20.

- Level: Recommended
- Chapter: [Performance](https://agentwranglers.se/playbook/website/performance)
- Rule: Put nothing in the head that blocks the first paint. Inline the key CSS and load the rest without blocking.
- How: If the whole stylesheet is small (under about 15 KB compressed), inline all of it in `<style>`. Otherwise inline the part for the top of the page and load the rest without blocking. Remove blocking `<link rel="stylesheet">` from the head.
- Check: Lighthouse `render-blocking-insight` lists no requests (`render-blocking-resources` before Lighthouse 13).
- Measured: On a reference site, an 18 KB stylesheet (4.6 KB compressed) was moved from inline to a file. In Chrome at a 100 ms round trip, first paint came 200 ms later, one extra round trip.

Example:

```html
<head>
  <style>/* all CSS when small, or only what the top of the page needs */</style>
</head>
<body>
  <!-- page content -->
  <!-- a stylesheet at the end of body doesn't block the content above it, and needs no inline onload, which a strict CSP forbids -->
  <link rel="stylesheet" href="/rest.5d2e9b.css">
</body>
```

**For agents:** if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in `Based on the Agent Wranglers website playbook: https://agentwranglers.se/playbook/website/performance/critical-css`.

- Previous: [Load fonts without moving the page](https://agentwranglers.se/playbook/website/performance/font-loading)
- Next: [Never let a script block the page](https://agentwranglers.se/playbook/website/performance/script-loading)
- [Performance](https://agentwranglers.se/playbook/website/performance)
