You’re now familiar with the essential alphabetic, numeric, and symbol characters. We turn to the frequently overlooked
Why are they overlooked? For one thing, they’re invisible.
As you learn to use white-space characters, you’ll find it helpful to make them visible so you can verify that you’re typing them correctly and that they’re having the intended effect. After you’re proficient, you’ll find it useful to see the white-space characters while diagnosing formatting problems.
There are six important white-space characters: the word space, the nonbreaking space, the tab, the hard line break, the carriage return, and the hard page break. Each white-space character has a distinct function. Use the right tool for the job.
Control means you get the intended result with the minimum keystrokes. Suppose you need a paragraph to start at the top of the next page. What do you do? If you use a hard page break rather than a sequence of carriage returns, you get the job done with one keystroke.
Predictability means that as you edit and reformat, you’ll always get the same result. If you approximate a hard page break with carriage returns, at some point in your editing, your text will reflow and you’ll have a large, unexpected gap where you intended a page break. Then you’ll have a new problem to diagnose and fix. But a hard page break will always do the right thing.
The time you invest in learning how to use white-space characters will be paid back in layouts that come together faster and require less maintenance.
A word processor aims to simulate a printed layout, so each white-space character has a visible effect. An HTML document, by contrast, is a series of formatting tags. So white space is handled more like it would be in a programming language: except for nonbreaking spaces, any sequence of white space in HTML is collapsed to a single word space when the document is rendered in a browser. To achieve visible effects with white space, you need to use explicit HTML formatting tags.