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 (­
) alongside the<wbr>
tag.
Specification
Browser Support
Desktop
Chrome | Edge | Firefox | IE | Opera | Safari |
---|---|---|---|---|---|
Yes | Yes | Yes | Yes | Yes | Yes |
Mobile
Android Webview | Chrome Android | Firefox Android | Opera Android | iOS Safari | Samsung Internet |
---|---|---|---|---|---|
Yes | Yes | Yes | Yes | Yes | Yes |