HTML <wbr> Element

The <wbr> element represents a word break opportunity, identifying a position where the browser may wrap text onto a new line when necessary. It is useful for long words, URLs, identifiers, and other strings that might otherwise extend beyond their container.

Syntax

longword<wbr>breakpoint

Attributes

The <wbr> element supports the global HTML attributes. It does not have any element-specific attributes.

Example

This example places <wbr> elements at suitable break opportunities within a long URL-like string. Resize the preview to see how the browser can wrap the text when there is not enough horizontal space.

Play in Editor

Usage Notes

The <wbr> element does not force a line break. It only tells the browser that a line break is permitted at that position if wrapping becomes necessary.

The <wbr> element is a void element and therefore does not have a closing </wbr> tag.

Use <wbr> when you know appropriate places where a long string can safely wrap. For general text wrapping and overflow behavior, CSS properties are usually more appropriate.

Unlike the <br> element, which creates a line break at a specific location, <wbr> allows the browser to decide whether a break is needed.

Accessibility

Because <wbr> only provides an optional wrapping opportunity, it should not be used to communicate a meaningful separation between words or ideas. The surrounding text should remain understandable whether or not the browser breaks the line at that position.

Browser Support

Baseline: Widely available indicates a feature has been supported by core browsers for at least 30 months. At this stage, the feature is considered stable and safe for most websites to use without needing to worry about compatibility issues or fallbacks, as it is supported by the vast majority of users' devices and browser versions.

For detailed browser compatibility information, see Can I Use: HTML <wbr> Element .

The <wbr> element is related to the <br> element. The <br> element creates a required line break, while <wbr> identifies a location where the browser may break the line only when necessary.

Specifications

The <wbr> element is defined in the WHATWG HTML Living Standard .