Menu
CoddyTech

Line Height

Part of the Fundamentals section of Coddy's Tailwind CSS journey. Lesson 13 of 55.

A two-line announcement with leading-5 uses 20-pixel line boxes. Line height controls the distance between text baselines, so it can improve reading comfort without increasing the glyph size.

<div class="leading-5">Museum sample</div>

Numeric leading utilities use the spacing scale. Choose line height after font size; an unusually tight value can make lines overlap even though the text still exists.

challenge icon

Challenge

Easy

Set the supplied two-line description to a 28-pixel line height.

Keep the supplied content and element IDs. Edit the HTML utility classes or the requested CSS. Click Run preview to refresh the preview after edits, then use Check/Run code to grade your work.

Try it yourself

<!doctype html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Practice studio</title><link rel="stylesheet" href="./styles.css"></head><body>
<div id="target" class="">Doors open at six.<br>Bring your ticket.</div>
</body></html>
quiz iconTest yourself

This lesson includes a short quiz. Start the lesson to answer it and track your progress.

All lessons in Fundamentals