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

Matthew Francis
Matthew Francis
6,967 Points

Importing fonts and fallbacks?

I'm confused on what the purpose of a fallback is regarding fonts.

Eg; font-family: "Times New Roman", serif;

If I import times new roman from google fonts, the user will enter the website and download times new roman; so why include a genneric font (like serif) as a fallback?

2 Answers

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

Hey Matthew,

The short answer is to just be safe. It's kind of like any kind of insurance. I have insurance, say, for my car. I don't plan on anything happening to it, but just in the unfortunate situation that it blows up... I've got it covered. Have a quick read from this page on css-tricks.

Hope that helps to explain. :) :dizzy:

Mark Wilkowske
PLUS
Mark Wilkowske
Courses Plus Student 18,131 Points

Hey Matthew, TNR is a universal web safe font meaning many devices have that already installed in the system fonts folder so you wouldn't need to import that one from Google Fonts. GF is used to import trendy fonts like Lato or Roboto Slab which typically would not be found in most fonts folders. 'serif' as a fallback font is when you are just asking for whatever serif font is available in the users system fonts folder because being specific could declare a font the user doesn't have and that won't be the look you want to put across.