👀 Live Preview
Compare wrapping with and without wbr in a narrow box:
With wbr
Visit https://www.example
Without wbr
Visit https://www.example.com/docs

The <wbr> tag suggests optional break points in text. This guide covers syntax, use cases for URLs and long strings, comparisons with similar tags, and responsive wrapping best practices.
Optional wrap points in long text.
Empty tag with no closing element.
Prevent awkward overflow on mobile.
Optional vs forced line breaks.
Pair with overflow-wrap.
Cleaner text on narrow viewports.
<wbr> Tag?The <wbr> element stands for word break opportunity. It tells the browser where it may wrap text onto the next line if the container is too narrow—without forcing a break when there is enough space.
Unlike <br>, <wbr> only takes effect when wrapping is needed. On wide screens the text flows normally; on narrow screens the browser breaks at your suggested points.
Use wbr for long URLs, file paths, email addresses, and compound words where breaking at the wrong character hurts readability.
Place <wbr> inside the word or string where a break opportunity should be suggested:
YourLongWord<wbr>Here<wbr> is a void element—no closing tag and no content.wbr elements in one string for several optional break points.<wbr> or <wbr /> in HTML5.| Use Case | Code Snippet | Notes |
|---|---|---|
| Basic break point | word<wbr>break | Inside a word or string |
| URL domain | example<wbr>.com | Break before TLD |
| Long path | /docs<wbr>/guide | Break at slashes |
| Compound word | authentication<wbr>before | Break long tokens |
| Attributes | None (void element) | Global attrs allowed |
<wbr> vs <br> vs <nobr>| Element | Effect | When to Use |
|---|---|---|
<wbr> | Suggests optional break point | Long URLs, paths, responsive wrap |
<br> | Forces a line break always | Poetry, addresses, hard breaks |
<nobr> | Prevents all breaks (obsolete) | Legacy only — use CSS nowrap |
CSS overflow-wrap | Breaks anywhere if needed | General long-word overflow |
With wbr
https://www.example
Without wbr
https://www.example.com/page
Combine semantic wbr hints with CSS for robust overflow handling:
.url-text {
overflow-wrap: break-word;
word-break: break-word;
}Use wbr when you want control over where breaks happen. Use CSS when any break point is acceptable.
The <wbr> tag has no tag-specific attributes. It is a void element whose purpose is entirely structural:
Element type VoidEmpty element with no content and no closing tag.
<wbr>Global attrs OptionalRarely used; class and id are valid but unnecessary.
<wbr>The entire purpose of wbr is its placement in text—no attributes are required or commonly used.
Long URLs, compound strings, and filenames with optional break points in narrow containers.
Compare wrapping with and without wbr in a narrow box:
With wbr
Visit https://www.example
Without wbr
Visit https://www.example.com/docs
Use <wbr> when default wrapping would break text at awkward positions on mobile or in sidebars.
Prevent lengthy URLs from overflowing by suggesting a break before the domain suffix.
<p>
Visit our website at https://www.example<wbr>.com for more information.
</p>Break within a long compound word or token where wrapping improves comprehension.
<p>
Ensure proper authentication<wbr>before accessing sensitive data.
</p>Insert multiple break opportunities in long file paths or hyphenated names.
<code>my-very-long-project<wbr>-documentation<wbr>-file.html</code>wbr is generally ignored; it does not add spoken pauses like br.Mark preferred break points in URLs, paths, or long tokens.
If the line fits, wbr has no visible effect.
When space is tight, the browser may break the line at a wbr position.
Text stays readable without horizontal overflow or awkward mid-character breaks.
The <wbr> tag is supported in all modern browsers. Internet Explorer 7+ includes support.
All major browsers honor wbr as an optional line break opportunity in responsive layouts.
Bottom line: Use <wbr> confidently for responsive text wrapping in all browsers your users run today.
Understanding and using the <wbr> tag improves readability and layout on responsive pages. Whether you are handling lengthy URLs or intricate strings, wbr provides a subtle, standards-based tool for controlling where text may wrap.
wbr at natural break points (dots, slashes, hyphens)overflow-wrap for overflow safetywbr tags for very long stringswbr instead of br when you need a forced breakwbr in normal prose paragraphswbr alone when CSS word-break is sufficient<wbr>Bookmark these before you wrap your next long URL.
<wbr> suggests where text may wrap.
No attributes, no content, no closing tag.
Syntaxwbr is optional; br is forced.
Break before .com and path slashes.
Only visible when the container is narrow.
Layout<wbr> element suggests an optional line break opportunity. The browser may wrap at that point when space is limited.br always forces a new line. wbr only allows a break when the line would otherwise overflow.wbr is a void element; global attributes are allowed but rarely needed.wbr before dots, slashes, or hyphens so URLs wrap cleanly on mobile without horizontal scrolling.nobr (obsolete) prevents all breaks. wbr allows breaks at specific suggested points.wbr element.Practice the <wbr> tag with URLs and long strings in the Try It editor.
5 people found this page helpful