Back to Content

: The Non-Breaking Text element

files/en-us/web/html/reference/elements/nobr/index.md

latest695 B
Original Source

{{deprecated_header}}

The <nobr> HTML element prevents the text it contains from automatically wrapping across multiple lines, potentially resulting in the user having to scroll horizontally to see the entire width of the text.

[!WARNING] Although this element is widely supported, it was never standard HTML, so you shouldn't use it. Instead, use the CSS property {{CSSxRef("white-space")}} like this:

html
<span class="nobr">Long line with no breaks</span>
css
.nobr {
  white-space: nowrap;
}

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also

  • {{CSSxRef("white-space")}}
  • {{CSSxRef("overflow")}}