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 trialMark Marino
1,306 PointsHow 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';
}
2 Answers
Milan Milosevic
6,647 PointsYou dont need to type quotes for sans-serif
h1 { font-family: 'Changa One', sans-serif;
}
try that
Mark Marino
1,306 PointsThat did it... thanks!!!
Milan Milosevic
6,647 PointsNo problem, you're welcome!
Ben Griffith
5,808 PointsI'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!
Jason Anello
Courses Plus Student 94,610 PointsJason Anello
Courses Plus Student 94,610 PointsHi 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;