wbr

The HTML <wbr> element marks an optional line-break opportunity. It helps long words, URLs, and identifiers fit narrow screens without inserting a visible space or a forced break.

What you will learn

Basic example

<p class="url">https://example.com/products/<wbr>very-long-product-name</p>

The browser may break the line at wbr if the text needs more room. If there is enough space, no break appears and no whitespace is added.

wbr does not add a space

An ordinary space separates words and can affect copy-and-paste or text processing. wbr is only a possible visual break; it does not change the text into two words.

<code>veryLong<wbr>IdentifierName</code>

Use CSS as the larger strategy

Responsive layout should normally use CSS properties such as overflow-wrap and sensible container sizing. Use wbr when a particular long token has a natural, safe place where a line may break.

Do not insert wbr at arbitrary points in a URL or identifier if breaking there would make the value hard to read or copy. Test the result with zoom and narrow viewports.

Common mistakes

Related pages