Help:Whitespace

__NOWYSIWYG__ Whitespace is any part of text which doesn't contain a visible character. It generally acts normally, but there are some situations where whitespace acts counter-intuitively, especially if entered using the source editor. This page lists some of those situations, and how to avoid them.

Line breaks
To get a line break to display on the page, two line breaks (or two presses of the enter/return key on your keyboard) are needed. If you only use one line break, the text after the line break will just continue on next to the text above it as if separated by a normal space character. For example:

By comparison:

However, single line breaks don't follow this pattern when part of a list of either ordered or unordered type. For example, using an unordered list:

When a line space is used inside a template it may end up being passed through to the article page, which can cause an unexpected line break when used inside a list. To prevent this, avoid unwarranted line breaks in templates.

Multiple spaces in a row
If you intend to separate text with multiple spaces, all those spaces will be condensed down to one single space instead of giving the desired spacing. For example:

This can be avoided by using what is known as a non-breaking space which doesn't collapse when a page is displayed to the reader. This is produced by typing. For example:

Note that this is only the case for normal space characters. Line breaks won't collapse on themselves with the exception of when a single line break is used, as mentioned above.

Whitespace at the beginning of lines
If a space is added at the beginning of a line or paragraph, all the following text will be placed inside a one line high box. For example:

This box is similar to the preformatted text box formed by using  HTML tags. The difference is that the box formed by whitespace at the beginning of lines does parse wikitext (see the example above, where  appears as a link).

Indentation
Whitespace and non-breaking space characters should be avoided for adding indention to a block of text. The wikitext equivalent, a colon at the beginning of a newline, should be used instead. The level of indentation can be changed using the number of colons placed:

Note that if you're indenting the text, the normal line-break collapsing rules don't apply and you can put a line of different indentation directly under another line.

Further help and feedback
es:Ayuda:Espacio en blanco ja:ヘルプ:空白と改行 tr:Yardım:Beyaz boşluk vi:Trợ giúp:Khoảng trắng zh:Help:空白区域