HTML / HTML Tags

HTML <Wbr> Tag

Dec 12, 2022
1 min read
HTML wbr Tag

Definition

A <wbr> specifies a word break opportunity. You can insert it into long words to select where it is ok for the browser to insert a word-break, which would usually have not done so.

Example

<p>
  Llanfairpwllgwyngyllgog<wbr />erychwyrndrob<wbr />wllllantysilio<wbr />gogogoch
</p>

Usage

  • Only an opening tag is required. It is an empty element, so it must not have a closing tag.
  • It can be used to allows line-breaks in long words, names, or URLs.

Attributes

The <wbr> element only supports the Global Attributes.

Best Practices

  • The <wbr> element does not insert a hyphen at the end of each line break. If you wish for a hyphen to be inserted, you can use the soft hyphen character entity (&shy;) alongside the <wbr> tag.

Specification

Browser Support

Desktop

ChromeEdgeFirefoxIEOperaSafari
YesYesYesYesYesYes

Mobile

Android WebviewChrome AndroidFirefox AndroidOpera AndroidiOS SafariSamsung Internet
YesYesYesYesYesYes