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

Why doesn't font show up?

I know fonts can be hard, but I need help on why this Chalkduster font won't work. Here's the code:

<html>
<head>
<style>
p {
   font-family: 'Chalkduster', fantasy;
}
</style>
</head>
<body>
<p>Hello</p>
</body>
</html>

3 Answers

Steven Parker
Steven Parker
231,261 Points

Where does that font come from? It doesn't look like you're linking in any font data, or including any external CSS file that might be loading it.

I found it online. It was under a page titled "CSS Fonts", I just assumed it was a CSS font

Steven Parker
Steven Parker
231,261 Points

I'm sure it is, but you still need to load it in the browser to make it available on the page.

I'd expect to see something like this (this example is not valid):

  <link href="http://fonts.yourcdn.com/css?family=Chalkduster" rel="stylesheet">

Where would I go to find a link like that?

Steven Parker
Steven Parker
231,261 Points

Well, there may not be a handy CDN serving your font. But if you have a font file you can provide it directly.

Are you creating this in a workspace? If so, be sure you've uploaded the font file and then make a snapshot of your workspace and post the link to it here.

No, I'm working in Notepad++

Steven Parker
Steven Parker
231,261 Points

You might want to create a workspace to make it easier to get help with it.