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 CSS Basics (2014) Enhancing the Design With CSS Web Fonts with @font-face

David DeWeaver
David DeWeaver
3,701 Points

The font of my h1 and h2 elements will not change

I copy- pasted the "Code-snippet" used to define the "Abolition Regular" font-family and I included the font- family in my "h1, h2" rule but neither my h1 nor my h2 elements changes from the previously defined Helvetica font.

Here is my font-family:

@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'); }

And my h1, h2 rule is:

h1, h2, { font-family: 'Abolition Regular', Helvetica, Arial, sans-serif; }

Does anybody have any clue what my problem is?

4 Answers

Ryan Field
PLUS
Ryan Field
Courses Plus Student 21,242 Points

Hi, David. It looks like you have an extra comma after your selectors. You just need commas between them, but no comma between the last and the first open curly brace, like so:

h1, h2 { font-family: 'Abolition Regular', Helvetica, Arial, sans-serif; }
Herb Bresnan
Herb Bresnan
10,658 Points

Hi, did Ryan's answer help. That is the only problem I saw as well.

David DeWeaver
David DeWeaver
3,701 Points

Wow...thank you Ryan, and thank you Herb. I've been looking at my stylesheet for two hours and didn't spot the error...you guys saw it in a matter of minutes. I guess sometimes it really pays to have someone else look at your work with a fresh pair of eyes. :) Now my website works as intended and I can move on! :D

Ryan Field
Ryan Field
Courses Plus Student 21,242 Points

You're very welcome! And you're right; fresh eyes are the best debugging tool there is much of the time! :)

Herb Bresnan
Herb Bresnan
10,658 Points

Hi David, I am glad you found the answer you were looking for and I appreciate the vote for best answer. However, in the future, please reserve the vote for best answer and the upvote for the person that actually provided the answer, in this case, Ryan. If I'm not mistaken, Treehouse users can look at the points earned, as well as points given for best answer in a subject and contact those individuals for help.

Best of luck, and hope to be of help in the future if you need it.