<wbr>

HTML4 HTML5

The <wbr> tag (Word Break Opportunity) indicates a spot within a very long word or URL where the browser may optionally break a line of text if space in the container runs out.

Unlike the <br> element, which forces a line break in all cases, the <wbr> tag breaks the line only when necessary based on the width of the screen or container.

It is an empty element (self-closing) – it has no closing tag or text content.

Attributes:

Example

In the example below, the <wbr> tag suggests safe break points to the browser for a long domain name or a very long compound word:

Code:

<p style="width: 180px; border: 1px dashed #999; padding: 5px;"> Visit page:<br> https://very<wbr>.long<wbr>.domain<wbr>.name.com </p>

The browser will interpret this code as follows (in a narrow container, the long address will break at the designated point):

Visit page:
https://very.long.domain.name.com