Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Start a free Courses trial
to watch this video
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.
Concepts
- 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.
Resources
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'>
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up