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

HTML

Lauren Muldoon
Lauren Muldoon
1,686 Points

I can't seem to get my font to change to Comic Sans, what am I doing wrong?

<!--Both paragraphs change to impact, but comic sans just isn't happening-->
<!DOCTYPE html> <html> <meta charset=:"utf-8"> <title>Second Try</title> <head> <style> h1{text-align:center; color:green} h2{text-align:right; color:aqua} p{font-family:"comic sans ms", cursive, sans-serif;} p{font-family:impact, charcoal, sans-serif} </style> </head> <body> <h1>Second Try!</h1> <h2>Please Work</h2> <p class="comic sans ms">I can't tell if I am learning this slower than I should be or if I am on track. I would always like to hope that I am progressing faster than average because of my competitve nature, but I have nothing to compare my progress to. It is a little upsetting.</p> <p class=impact>Then again, I have a tendency to be my own worst enemy. The logical side of me thinks that I should just get out of my own head and be grateful that I am even motivated enough to pursue knowledge. I think Spock would be proud of my logic :)</p> </body> </html>

5 Answers

David Wood
David Wood
5,705 Points

If you will call your <p> comic sans ms </p> class by the name of .comic and your <p> impact class by the name of .impact then this code will work.

let me give you the first so you will see how it can look: p{font-family:"comic sans ms", cursive, sans-serif;} *this is your code*

.comic{font-family:"comic sans ms", cursive, sans-serif;}

then in the html call the class with <p class="comic">

instead of *<p class="comic sans ms">*

I hope that this is helpful and not confusing.

Tabatha Trahan
Tabatha Trahan
21,422 Points

It looks like you assigned style to only the paragraph elements so the last one -sans-serif will be the one used on your paragraphs. You assigned classes to each paragraph, so that's what you'll want to use in your stylesheet:

<style>
  .comic {font-family: "comic sans ms"}

</style>

I think you'll also want to lose the spaces in the class name like above. Hope this helps

David Wood
David Wood
5,705 Points

I am sorry this did not translate very well, let me just give you the code:

<style> h1{text-align:center; color:green} h2{text-align:right; color:aqua} .comic {font-family:"comic sans ms", cursive, sans-serif;} .impact {font-family:impact, charcoal, sans-serif} </style> </head> <body> <h1>Second Try!</h1> <h2>Please Work</h2> <p class="comic">I can't tell if I am learning this slower than I should be or if I am on track. I would always like to hope that I am progressing faster than average because of my competitve nature, but I have nothing to compare my progress to. It is a little upsetting.</p> <p class=impact>

Perhaps you're missing a space? After the "font-family:" :

p{font-family: "comic sans ms", cursive, sans-serif;} p{font-family: impact, charcoal, sans-serif}

Lauren Muldoon
Lauren Muldoon
1,686 Points

Thank you guys for all your help. What you recommended worked great David. Thank you so much. I actually just changed the ".comic" that you recommended and it worked.