| Depr. | Empty | Version |
|---|---|---|
| Yes | No | N/A |
| IE5.5+ | FF1+ | SA1.3+ | OP9.2+ | CH2+ |
|---|---|---|---|---|
| Full | Full | Full | Full | Full |
Syntax
Description
The nobr
element is a proprietary (as in not based on any standard) one that was
used to define sections of text that the browser should not allow to wrap,
regardless of what may happen, for example the user resizing the window to
a small viewport. As it is deprecated - and the effects can be achieved
using CSS - you should not use the element; this is here for reference
only.
Using the telephone number example shown here, the image
below shows the number firstly if it were viewed with plenty of window
width, and secondly where the nobr element content gets
wrapped:

Example
nobr is being
used here to avoid a telephone number getting wrapped mid
number:
<p>Our telephone number is <nobr>0800 123 123 123</nobr>.</p>
Use this for…
Anything goes.
Compatibility
| Internet Explorer | Firefox | Safari | Opera | Chrome | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 5.5 | 6.0 | 7.0 | 8.0 | 1.0 | 1.5 | 2.0 | 3.0 | 3.5 | 1.3 | 2.0 | 3.1 | 4.0 | 9.2 | 9.5 | 10.0 | 2.0 |
| Full | Full | Full | Full | Full | Full | Full | Full | Full | Full | Full | Full | Full | Full | Full | Full | Full |
The
nobr element has good support in modern browsers (for
backwards-compatibility reasons) but should not be used. The pre element may be a suitable
HTML alternative in some circumstances, but most likely you would opt for
a CSS-based solution (white-space:nowrap). If you are not
positive that your intended audience has browsers that support the
white-space CSS property (refer to server logs and stats
to be sure), you may opt for using the non-breaking space HTML entity
. That entity is never to be used for
the purposes of creating arbitrary space/padding effects, but substituting
a single space character with a non-breaking space for this purpose is
acceptable (if somewhat uglier to the eye).
User-contributed notes
Add a note
To post a note on this topic, please log in with your SitePoint username and password. If you don't have an account yet, you can create a new account for free.