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

General Discussion

Web Fonts: Pros and Cons

I am curious to know the pros and cons of using a webfont that is not very common. I am looking at using Gotham on my site and I am wondering if this is a good idea for browser compatibility?

2 Answers

The biggest drawback from web fonts are load times. Having 3 or more types of linked fonts, you will notice some impact on the page. There are some tricks to force browsers to cache this information but since they are tricks, it is tricky to accomplish it. And talking about compatibility, this is what fall-back fonts are for. Simple declare additional fonts so that if the first one is not available, it loads the next one, like this:

.body {
  font-family: "Gotham", sans-serif, serif;
}

This will make it so that if Gotham is not available, it will use a sans-serif font instead. If this one is not available "that would be strage", it will use a serif font.

Thanks. That's what I was thinking, but I just wanted to check since I am still a bit of a newbie.