Whitespace

Whitespace is a set of characters which is used to show horizontal or vertical spaces between other characters. They are often used to separate tokens in HTML, CSS, JavaScript, and other computer languages. Whitespace characters and their usage vary between languages.

In HTML

HTML Living Standard specifies 5 characters as the ASCII whitespace: U+0009 TAB, U+000A LF, U+000C FF, U+000D CR, and U+0020 SPACE. In text, they are treated as normal space characters and sequencial whitespaces are collapsed as a single space in many cases (this behavior can be changed by the white-space CSS property. They are also used as a separator of an element name and its parameters, of class names, and so on.

In JavaScript

ECMAScript® 2015 Language Specification specifies several Unicode codepoints as white space: U+0009 CHARACTER TABULATION <TAB>, U+000B LINE TABULATION <VT>, U+000C FORM FEED <FF>, U+0020 SPACE <SP>, U+00A0 NO-BREAK SPACE <NBSP>, U+FEFF ZERO WIDTH NO-BREAK SPACE <ZWNBSP> and Other category “Zs” Any other Unicode “Separator, space” code point <USP>. These characters are usually unnecessary for the functionality of the code.