Optimize CSS5:55 with Nick Pettit
There are several guidelines and techniques that can help optimize CSS. Removing CSS imports and using hosted font services can help speed up page load times.
- Avoid @import - Using the @import CSS rule introduces more roundtrips from the browser to the server.
- Use Hosted Services - Using hosted services is better for speed and reliability, for additional parallel HTTP connections, and for better caching.
Validation of Google Fonts
Sometimes Google Fonts don't validate properly. This is not always critical, but if you do want full validation, be sure to replace any vertical pipes | with a %7C encoding. For example, the URL in this video will validate when modified as follows:
<link href='http://fonts.googleapis.com/css?family=Changa+One%7COpen+Sans:400italic,700italic,400,700,800' rel='stylesheet' type='text/css'>
You need to sign up for Treehouse in order to download course files.Sign up