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 How to Make a Website Customizing Colors and Fonts Add Fonts

Erik Heyl
Erik Heyl
4,249 Points

Correct way to include fallback in Code Challenge?

h1 { font-family: 'Changa One', 'sans-serif'; }

Is this not the correct way to include your font and fallback? I do this, in the code challenge and yet it keeps saying to include the sans-serif fall back...confused? Wondering if it could be perhaps because I'm on a VERY old XP machine?

3 Answers

Hi Erik,

If you put quotes around sans-serif then the browser looks for a font named "sans-serif"

You want to leave the quotes off because you want to use the keyword sans-serif Any font name keywords should be unquoted.

Erik Heyl
Erik Heyl
4,249 Points

Yup, thanks Jason, just ran it through a CSS validator...I feel so dense. Onward!

You're welcome.

Did the validator say there was an error? There wasn't anything wrong with your css. It just wasn't what the challenge wanted.

Erik Heyl
Erik Heyl
4,249 Points

It told me the same thing: that sans-serif was a generic fount name keyword and should be unquoted.