×

css · level 1 · unit 3 · lesson 2

  1. meet it
  2. guess first
  3. your turn
  4. fix it
  5. nailed it

Tap a green word if you get lost.

meet it

font-family picks the shape of the letters.

font-family chooses which font the browser uses. Not every computer has every font, so you give a list, with commas between. The browser tries each one in order.

End the list with a , a general family every computer has: serif, sans-serif or monospace. serif letters have little feet, sans-serif letters do not, and monospace letters are all the same width.

Font names with spaces go inside quote marks, like "Comic Sans MS".

<h1>Once upon a time</h1>
<p>There lived a dragon who loved tea.</p>
h1 {
  font-family: Georgia, "Times New Roman", serif;
}
p {
  font-family: Arial, sans-serif;
}

Press show my page to see it here.

The browser stops at the first font in the list that it can find.