2.8 Whitespace Collapsing
The next block element we’ll describe is the pre element. But for the pre element to make sense, we first need to explain whitespace collapsing. Whitespace refers to characters that are invisible when displayed on the browser window. The most common whitespace characters are the blank, newline, and tab characters. The web developer generates those characteristics by pressing the spacebar, enter, and tab keys, respectively. Normally, browsers collapse whitespace. In other words, if your HTML code contains consecutive blank spaces, newlines, or tabs, the browser will display the web page with only one whitespace character (usually a blank space).
For an example of whitespace collapsing, let’s look at a haiku web page. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access