Hubbry Logo
search
logo

Non-breaking space

logo
Community Hub0 Subscribers
Write something...
Be the first to start a discussion here.
Be the first to start a discussion here.
See all
Non-breaking space

In word processing and digital typesetting, a non-breaking space ( ), also called NBSP, required space, hard space, or fixed space (in most typefaces, it is not of fixed width), is a space character that prevents an automatic line break at its position. In some formats, including HTML, it also prevents consecutive whitespace characters from collapsing into a single space. Non-breaking space characters with other widths also exist.

Despite having layout and uses similar to those of whitespace, it differs in contextual behavior.

Text-processing software typically assumes that an automatic line break may be inserted anywhere a space character occurs; a non-breaking space prevents this from happening (provided the software recognizes the character).

For example, if the text "100 km" will not quite fit at the end of a line, the software may break the line between "100" and "km". Using a non-breaking space between "100" and "km" will prevent this behaviour. This guarantees that the text "100 km" will not be broken—if it does not fit at the end of a line, it is moved in its entirety to the next line. For this reason, many style guides recommend using a non-breaking space between numbers and their associated units.

In French typography, non-breaking spaces are used before "high punctuation" (:, ;, ?, and !), on the interior side of guillemets (« and »), and before footnotes. In the case of ;, ?, !, and footnotes (unless enclosed by parentheses), it is specifically the narrow non-breaking space that is used.

In German typography, it is used between multi-part abbreviations (e.g., "z. B.", "d. h.", "v. l. n. r.").

A second common application of non-breaking spaces is in plain text file formats such as SGML, HTML, TeX and LaTeX, whose rendering engines are programmed to treat sequences of whitespace characters (space, newline, tab, form feed, etc.) as if they were a single character (but this behavior can be overridden). Such "collapsing" of whitespace allows the author to neatly arrange the source text using line breaks, indentation and other forms of spacing without affecting the final typeset result.

In programming languages or in software analysis languages (such as SAS or R) non-breaking spaces can be useful to fill character-type variables with spaces that are not to be considered insignificant. In general, a string filled with spaces can be interpreted as an empty string or a string of missing data. Replacing ordinary spaces with non-breaking spaces helps resolving the ambiguity between "space", "void" and "missing". The non-breaking space code for R is \u00A0.

See all
User Avatar
No comments yet.