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

brandonlind2
brandonlind2
7,823 Points

Could someone please tell me why my CSS font-family isn't working?

My font-family property isn't working, if I put another value in it besides sans-serif and I can't figure out why.

body {max-width: 100%;
           margin: 0 auto;
           line-height: 1.5;
           font-family: "times new roman";}

Also why doesn't sans-serif need to be in "" since it's a two word font family value. I noticed instead it uses a -. Is there a reason for this, is this just an oddity or is it optional to use '' or - for all two word font-family values?

MOD edit: formatted code.

5 Answers

Brandon- Try this:

font-family: "Times New Roman", Georgia, sans-serif;

Brandon- Yes, capitalize font families like Times New Roman but not generic fonts like serif and sans serif.

Brandon- try this:

body {
    font-family: "Times New Roman", Georgia, sans-serif;
    max-width: 100%;
    margin: 0 auto;
    line-height: 1.5;
    }

Can you tell me the name of this code challenge so I can try it and see what's up?

brandonlind2
brandonlind2
7,823 Points

Thanks for the reply, nope it's still not working. Do the first letter of words in times new roman need to always be capitalized?

brandonlind2
brandonlind2
7,823 Points

Thanks!, is there something else that would cause it not to work? I'm still having difficulty getting any type font to work. I've copy and pasted this {font-family: "Times New Roman", Georgia, sans-serif;} into multiple practice websites and it hasn't work for any of them. The code looks right, so I not sure whats up.