Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
July 30, 2019 02:31 pm GMT

The Simplest Way to Load CSS Asynchronously

Scott Jehl:

One of the most impactful things we can do to improve page performance and resilience is to load CSS in a way that does not delay page rendering. Thats because by default, browsers will load external CSS synchronouslyhalting all page rendering while the CSS is downloaded and parsedboth of which incur potential delays.

<link rel="stylesheet" href="https://css-tricks.com/path/to/my.css" media="print" onload="this.media='all'">

Don't just up and do this to all your stylesheets though, otherwise, you'll get a pretty nasty "Flash of Unstyled … Read article

The post The Simplest Way to Load CSS Asynchronously appeared first on CSS-Tricks.


Original Link: https://www.filamentgroup.com/lab/load-css-simpler/

Share this article:    Share on Facebook
View Full Article

CSS Tricks

A Web Design Community curated by Chris Coyier

More About this Source Visit CSS Tricks