Web Typography Demo

For an upcoming presentation on web typography, I put together a demo piece showing simple steps that can be taken to improve readability of text. The demo takes the first few paragraphs of Charles Dickens’ “A Tale of Two Cities” and shows the steps that can be taken from no formatting, to easy readability. These include appropriate line-heights, margins, letter-spacing, line-measure, and font pairings.

Many of these principles can be seen in the Type CSS Framework that I posted about recently. A quick overview:

Line Height

Increasing line-height can improve readability, and help readers follow lines more easily. For this demo, I set the body line-height to 1.5 and the header to 1.25. Line height should always be set as a multiplier of the font-size, not an explicit height in pixels, ems, or percentages.

Margins

To keep the vertical rhythm consistent, a 1.5rem margin is applied to the bottom of all headings and paragraphs. I am a proponent of single-direction margins to avoid “margin collisions” where a top and bottom margin may run up against each other. Likewise with horizontal margins, using “margin-right” will maintain consistency. By only using “margin-bottom” and “margin-right” all margins are created flowing from the top-left of the page.

Letter-spacing

Different from kerning, letter-spacing defines the space between all characters on the page. For this demo, the spacing is set to 0.01rem. More on using rem, I prefer rem over em because all rem units refer to the font-size defined in the html element of the page. Since em units refer to their parent element, if the font-size changes then sizing will no longer be consistent across the page.

Measure

The measure of the page can be controlled by sizing the width. There is no recommended measure in the demo, but between 60 and 90 characters is accepted as optimum for readability. Too wide of a page makes it difficult to track lines, and too short begins to feel disjointed and difficult to follow text line-to-line.

Color

One of the more subtle changes to the text, changing the header and body to #222 and #444, respectively, makes for slightly lower contrast. This lower contrast still passes webAIM standards, but is softer on the eyes when reading for a long period of time.

Font Pairing

A simple two-font pairing, using two system font-stacks, the pairing creates a visual hierarchy between the headers and body.

Web Typography Demo