examples
- Arial
- Verdana
- Times New Roman
more examples
- Serif
- Sans-serif
- Monospace
- Fantasy
- Script
example
font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
Breakdown
- Property:
- Preferred font first
- Comma-separated fallbacks
- General category last
Why do i have
to do this?
I just want the browser to use what I tell it to.
End of story.
browsers use what they find first
font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
browser path breakdown
- Browser: I'm looking for Arial.
- User: I don't have that font.
- Browser: Ok, well... what about Helvetica Neue?
- User: Nope. Don't have that either.
- Browser: Gosh! What about just Helvetica?
- User: Nope. Try again.
- Browser: Fuck it. Just use a sans-serif font.
- User: Sounds good! Here's Verdana!
font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
what's with the quotes?
rule of thumb
- Font name more than one word?
- Put it in quotes
exercise
- Add a Level-1 Heading to your page
-
Tell the browser to use Helvetica as it's font family
- If it can't find that, use Arial
- If it can't find that, use Verdana
- If it can't find that, use any sans-serif font
currently installed on the user's computer