ARCHIVED: In HTML, what is a non-breaking space?
A non-breaking space prevents line breaks from occurring at a particular point in an HTML document. To use a non-breaking space, you would use the following:
For example, if you wanted the words "Mr." and "Foo" to appear together even if a line break would normally separate the two words, you would use the following:
Mr. Foo
Unlike other empty spaces in HTML documents, the effects of non-breaking spaces are cumulative. That is, while browsers weed out extra white space when rendering a page, all non-breaking spaces are rendered. They're especially useful inside <code> tags, for example:
<code> </code>
These tags cause the spaces to be rendered in a monospace font rather than a proportional font, thus guaranteeing that the spaces will always appear with a fixed size.
A non-breaking space also counts as real content, which is useful to produce an empty table data cell when you have table borders turned on, for example:
<td> </td>
The symbols that produce the non-breaking space ( ) form what is called a character entity. Many such character entities exist for producing unusual characters in HTML documents. For more information, see ARCHIVED: How do I use special characters on my web page?
Related documents
This is document agjn in the Knowledge Base.
Last modified on 2018-01-18 12:26:13.