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

Unsure what the error message refers to. It is saying that I have not yet set a font-family for h1.

-for h1. I have placed the code in various places in relation to other code but still not passing this challenge. Is there something wrong with this code?
h1 { font-family: 'Droid+Sans', sans-serif } Challenge question: "In your CSS, apply your font to the first level headline using font-family. Include a sans-serif fallback."

5 Answers

Julian Gutierrez
Julian Gutierrez
19,201 Points

Is there a semicolon at the end of your css declaration? Also make sure you are writing your css in the css/main.css file.

Julian Gutierrez
Julian Gutierrez
19,201 Points
  1. Are you remembering to link to the font in the head section of your html file?
  2. When you are assigning 'Droid+Sans' in your h1 css I don't think the plus character is needed.

Thanks, Julian. How do I link the font to html?

Julian Gutierrez
Julian Gutierrez
19,201 Points

I'm pretty sure that was the first part of the challenge but assuming your still using "Droid Sans" below is the code you should use.

<link href='http://fonts.googleapis.com/css?family=Droid+Sans' rel='stylesheet' type='text/css'>

Yes. Did this. Between the main and custom CSS. I have also used this code and it is still wrong.

h1 { font-family: 'Droid Sans', sans-serif; }

Thanks. I knew that the answer would be very simple.