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. FooUnlike 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 How do I use special characters on my web page?
Also see:
- At IU, where can I get help creating a web page?
- In HTML, how do I change the color of the text and background of a web page?
- What are the RGB values of some common colors?
- What is CSS?
Last modified on April 29, 2008.






