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

How is this not correct for Task 2? h1 { font-family: 'Changa One', 'sans-serif'; }

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

}

I even tried:

h1 { font-family: 'sans-serif';

}

h1 , h2 { font-family: 'sans-serif';

}

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

}

Hi Mark,

You already have the answer but I wanted to point out that the css you tried is completely valid css, just not what the challenge wanted.

When you put quotes around sans-serif then the browser is looking for a font that is literally named "sans-serif" similar to how it will first look for a font named "Changa One"

When you use it without the quotes then it becomes the sans-serif css keyword. This instructs the browser to retrieve the default sans-serif font, whatever that might be.

That means this is also completely valid: font-family: 'sans-serif', sans-serif;

2 Answers

You dont need to type quotes for sans-serif

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

}

try that

That did it... thanks!!!

No problem, you're welcome!

Ben Griffith
Ben Griffith
5,808 Points

I've not done the task, but you shouldn't have any quotes around sans-serif.

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

Give that a go and let me know how you get on!

Edit! Milan beat me to it!