Description
The HTML element <wbr>
is used to specify a word break position with a lengthy text, where the browsers can optionally break.
The word wbr
stands for Word Break Opportunity.
If the content has a text that is too long, then this element can be used to define a position for word-break for word wrap purposes.
The below table summarizes its usage.
Usage Details | |
Placement | It is displayed as an Inline element. |
Contents | None. It is an empty element. |
Tags | Opening tag: required; Closing tag: forbidden |
Versions | HTML 5 |
Syntax
Here is the basic syntax of the <wbr>
element.
<wbr>
Examples
<!DOCTYPE html>
<html lang="en">
<head>
<title>Example - HTML Element wbr</title>
</head>
<body>
<h2>Example for HTML element wbr</h2>
<p>This paragraph contains a longggggg<wbr>ggggggggggggggggggggggggggggggggggg<wbr>ggggggggggggggggggggggggggggggggggggggg<wbr>ggggg text.</p>
<p>NOTE: Try to shrink the browser window to see how the word break happens in action.</p>
</body>
</html>
Attributes
The following table shows the list of supported and unsupported attributes for the <wbr>
element.
Attribute Type | Details |
Element-Specific Attributes | The tag <wbr> doesn't have any element-specific attributes. |
Global Attributes | Like all other HTML tags, the tag <wbr> supports the HTML Global Attributes. |
Event Attributes | The tag <wbr> also supports the HTML Event Attributes. |
Browser Compatibility
The tag <u>
is supported in all modern browsers.
- Google Chrome 1+
- Internet Explorer or Edge x
- Firefox 3+
- Apple Safari 4+
- Opera 11.7+