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

Custom Fonts Do Not Work

On a CSS course, I am supposed to download a custom font. It doesn't work! I have followed the directions in the video: Go to the "Fonts" folder, and open up a specific file [I forgot what it is called].

Though I have been experiencing some pretty weird things with fonts recently on my computer.

Here is my CSS:

/* Web Fonts -------------------- */

@font-face {
  font-family: 'Abolition Regular';
  src: url('../fonts/abolition-regular-webfont.eot');
  src: url('../fonts/abolition-regular-webfont.eot?#iefix') format('embedded-opentype'),
       url('../fonts/abolition-regular-webfont.woff') format('woff'),
       url('../fonts/abolition-regular-webfont.ttf') format('truetype');
}

Where is the font file stored on YOUR system?

It is stored in the same folder as in the video.

1 Answer

One troubleshooting measure would be to have a look at the Console output when the page is loaded. The @font-face definition uses relative paths, so if it is not working, one of the things that could be wrong is that the path is not correct resulting in the resource not being found. Look in the Console and check the path of the resource that is 404(if there is one) and most likely it will be incorrect. Figure out what the difference is between the path where the resource is actually located in the filesystem and the path that is being requested. You can use that information to either update your path definition or move the files to where the definition says they are.

I suppose this should have been a comment!

Well, I didn't follow exactly what you wrote, but I did about half and it worked! Thanks for your help!

My pleasure David, happy I could help!