Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

What happens if fonts.googleapis.com is down?

What fonts are used if fonts.googleapis.com is down? Why would it be better to load fonts from there instead of having them directly in your project files?

Thanks

J-L

1 Answer

Hi there

You include fonts in your Css file like so

body {
  font-family: Roboto, sans-serif;
}

If Roboto i.e the google font is unavailable it reverts to sans-serif, so its always better to specify a backup, just in case the default isn't supported across Mac/Pc. As for the benefits to getting them from a CDN, smaller file size, client doesn't have to download the font. The typography and design courses explain better than me :p I recommend checking them out.

Hope this helps Paul