Indiana University
University Information Technology Services
  
What are archived documents?

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>&nbsp;</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>&nbsp;</td>

The symbols that produce the non-breaking space (&nbsp;) 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:

This is document agjn in domain all.
Last modified on April 29, 2008.
Please tell us, did you find the answer to your question?