liveBook · Manning

Line height

As explained in Web Design Playground, Second Edition

The CSS line-height property specifies the height of each line box used to lay out text.

The CSS line-height property sets the height of each line box: the browser’s invisible box around a line of text. Line height—also called leading—affects how comfortably lines can be read. section 18.7

Table 18.1 Values you can apply to the line-height property (view table figure)

Value

Description

number

A numeric value entered without a unit. The computed line height is the current type size multiplied by the number.

length

A numeric value entered with a unit, such as em..

percentage

A percentage value. The computed line height is the current type size multiplied by the percentage.

normal

A keyword that tells the browser to set the line height automatically based on the current type size.

Line-height values can be numbers, lengths, percentages, or the keyword normal. A unitless number multiplies the current type size; normal lets the browser set the height automatically. section 18.7

Tune the spacing

A value of 0.9 creates tight leading; try around 1.4 for normal spacing or 1.75 and higher for loose spacing. For a long page title that wraps, a value below 1, such as 0.8 or 0.9, brings its lines closer together. section 18.7 section 5.5

How Web Design Playground, Second Edition covers it

How deep it goes
Defines the line box and value types, then illustrates tight, normal, and loose spacing without exploring browser internals.
Examples
Compares values of 0.75, 1.5, and 2.25, and tightens a wrapped page title with 0.8 or 0.9.
What you can do after
Apply it via CSS to adjust paragraph spacing or tighten a wrapped page title.
How it connects
Connects line height to typography, font size, and text readability.

Also explained in

Compare how 8 books explain line height →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Web Design Playground, Second Edition. The section links point to the parts of the book it draws on.