Lesson 38 of 50
cssCSS Performance – Critical CSS & Unused CSS
9 mins
Course progress76%
What you'll learn
Keep this idea in mind as you work through the lesson.
Lesson 38 of 50
css9 mins
Keep this idea in mind as you work through the lesson.
Critical CSS is the minimal set of styles needed for above‑the‑fold content.
<head> to avoid a render‑blocking request.rel="preload" + as="style" and change to rel="stylesheet" on onload.<style>
.hero{background:#333;color:#fff;padding:4rem;text-align:center;}
</style>
<link rel="preload" href="/css/main.css" as="style" onload="this.rel='stylesheet'">
<noscript><link rel="stylesheet" href="/css/main.css"></noscript>