Programming Terminology

Whitespace

Related to: Plaintext, HTML

In written text like plaintext, whitespace is any character that does not make a visible mark such as spaces, tabs, hard-returns, etc.

Whitespace is considered a significant topic in programming languages because depending on the language, whitespace is either ignored or interpreted to have meaning. For example, in HTML whitespace is mostly ignored -- all repetitive whitespace will be reduced down to one space when rendered in the browser.

Here is an example of repetitive whitespace in HTML:

<p>Hello
World
</p>
<p>Hello World</p>

In both cases, the output will be:

output

In CSS, whitespace is completely ignored. There's no difference between these two rulesets:

p {
margin: 0;
}
p { margin: 0; }