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

Design

COURTNEY KLASSEN
COURTNEY KLASSEN
431 Points

Adding Fonts to Your Website

Hi,

Im working on the Pick Fonts and Set Relative Units part of the How To Make A Website video and I just purchased a font off of MyFonts.com and am having problems trying to add it to my code. Any help would be great. TIA!

3 Answers

Joseph Alejandro
Joseph Alejandro
1,428 Points

Hey, First can you give us more information about the problem? Did you add the link element to your html file. Like this example from the google fonts site,

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

or is the problem on your css?

COURTNEY KLASSEN
COURTNEY KLASSEN
431 Points

In all honesty, Im new at this so I have no idea if it's my css or the html link element. Im thinking it's the html but i could be wrong. Because I didn't get a font from google.com/fonts, like the Pick Fonts and Set Relative Units video, the link element is a bit different. There's a fairly large licensing comment before the link element which it says to include when copying and pasting into my html. However, the link element doesn't include the actual name of the font in it, which i thought it was supposed to.

COURTNEY KLASSEN
COURTNEY KLASSEN
431 Points

I figured it out. Thanks anyways Joseph!