<wbr>
<wbr>
Tag
The <wbr>
element in HTML specifies a possible line break, allowing the browser to wrap text at that point when necessary. This is especially useful for handling long words or uninterrupted text strings that might overflow their container.
Syntax
<wbr>
<wbr>
Demo
A demonstration of text wrapping at suggested breakpoints:
Resize the browser window to see how the long word in the paragraph below breaks:
This is a veryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryvery
<h1>The wbr element</h1>
<p>Resize the browser window to see how the long word in the paragraph below breaks:</p>
<p>This is a veryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryvery<wbr>longwordthatwillbreakatspecific<wbr>placeswhenthebrowserwindowisresized.</p>
Definition and Usage
The <wbr>
(Word Break Opportunity) tag provides hints to the browser about where a word can be broken if required for better text wrapping.
<wbr>
can suggest ideal places for a line break, preventing awkward text overflow.Attributes
The <wbr>
element supports global attributes.
Conclusion
The <wbr>
tag is a helpful tool for controlling text wrapping, particularly in cases of long words or continuous text strings. It does not force a line break but allows the browser to determine an appropriate break point when needed. Using <wbr>
enhances text readability across various screen sizes and layouts.
<var>
The HTML <var> element denotes a variable in mathematical expressions or programming contexts, usually displayed in italics to signify that its value may vary.
<xmp>
The HTML <xmp> element, which is now obsolete, was used to display preformatted text with visible HTML tags. Today, the <pre> element or code escaping techniques serve as modern alternatives.