×

css · level 1 · unit 3 · lesson 4

  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

line-height adds room between the lines.

When a paragraph wraps onto several lines, the room each line takes up is its . Too little and the lines feel crammed. A bit more makes long text .

Give line-height a plain number with no unit, and it works as times the font size. 1.5 on 16px text gives each line 24px of room.

One rule can mix every text property you have met: font, size, weight, alignment and line height. Keep each declaration on its own line so it stays tidy.

<p>Hedgehogs snuffle about at night, looking for beetles, worms and slugs. One hedgehog can wander two miles in an evening.</p>
p {
  font-family: Georgia, serif;
  font-size: 18px;
  line-height: 1.6;
}

Press show my page to see it here.

Try 1 and then 2 to feel the difference.