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 trialJulian Williams
1,022 PointsChanging 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
2,435 Pointsh1 {
font-family: Arial, Helvetica, sans-serif;
}
lucybeck
6,055 PointsHi Julian, Good question. With CSS, you have more control over styling the font than in HTML. Here is an example of code :
- Specifying area of site in a font: body
-
Font type: Garamond.....
body { font-family: Garamond, Times, serif; }
Konrad Pilch
2,435 PointsThere 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.
Julian Williams
1,022 PointsThanks Konrad and Lucy.
Konrad Pilch
2,435 PointsKonrad Pilch
2,435 PointsGoogle fonts
Just play around with it and see if you can figure it out how to put it in HTML, thats what i did.