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 Treehouse Club: HTML Publish a Story The Body

Changing fonts...

Possibly a dumb question, but how does one change the font in HTML/CSS? I know there must be a way, and I'm sure it's very simple, but I've looked but can't see it...

3 Answers

Konrad Pilch
Konrad Pilch
2,435 Points
h1 {
    font-family: Arial, Helvetica, sans-serif;
}
Konrad Pilch
Konrad Pilch
2,435 Points

Google fonts

Just play around with it and see if you can figure it out how to put it in HTML, thats what i did.

Hi Julian, Good question. With CSS, you have more control over styling the font than in HTML. Here is an example of code :

  1. Specifying area of site in a font: body
  2. Font type: Garamond.....

    body { font-family: Garamond, Times, serif; }

Konrad Pilch
Konrad Pilch
2,435 Points

There are many more fonts thatn that , they don thave to be Garamond etc..

The reason why you put 3, is in case the browser or computer dont work.

If im on windows, helvetica will skip it to arial, and if i don thave arial either.. it will go to sans-serif. If im on Mac, it will skip arial and give me helvetica.

Thanks Konrad and Lucy.