CodePark/ questions / Rendering pipeline & critical path
START PRACTICINGPRACTICE
Frontend question · Browser & web performance › Rendering pipeline & critical path

How does the browser treat this stylesheet when the page loads on a normal screen?

<link rel="stylesheet" href="print.css" media="print">
It downloads it, but it does not block the first render

The browser still downloads a stylesheet whose media query does not match, usually at low priority. But it does not block the first render.

"It never downloads it" is wrong, because the browser fetches it anyway in case the media query starts to match, for example when the user prints. "It blocks rendering like any other stylesheet" is wrong, because only matching stylesheets block rendering. This is why splitting CSS by media query can shrink the set of render-blocking files.