freecoding.school100% FREE · NO SIGNUP
Neon DistrictISSUE #42 of 50

@import · loading stylesheets

PrismaVSJank the Janitor
Prisma says@import pulls one stylesheet into another — convenient, but it can slow loading.

@import url("base.css") at the top of a stylesheet loads another. Handy for organizing CSS, but imports load sequentially, delaying rendering. For production, prefer multiple <link> tags or a build step that bundles. @import can carry media conditions.

Power-ups you unlock

Jank the Janitor attacks — common mistakes

Boss battleNote where @import must go and why three <link>s beat three @imports.

Example code

<!doctype html><html><head><meta charset="utf-8">
<style>/* @import url("base.css"); must be first */ body{background:#06040d;color:#e6e0ff;padding:20px}</style></head><body><p>@import must precede all other rules — and loads serially.</p></body></html>
▶ Open the interactive comic issue
‹ @Supports · Feature Queries@Layer · Cascade Layers ›