#1 Data Analytics Program in India
₹2,499₹1,499Enroll Now
3 min read
•Question 42 of 49easy

What is the WBR Element?

Word break opportunities.

What You'll Learn

  • Using the wbr element
  • When to allow breaks
  • Difference from br

The WBR Element

The <wbr> element suggests a word break opportunity. The browser can break the line at this point if needed, but won't if there's enough space.

Key Difference

ElementBehavior
<br>Always breaks
<wbr>Breaks only if needed

Examples

index.htmlHTML
<!-- Long URL -->
<p>Visit: https://example.com/<wbr>long/<wbr>path/<wbr>to/<wbr>page</p>

<!-- Long technical term -->
<p>The error was <code>Null<wbr>Pointer<wbr>Exception</code>.</p>

<!-- Long compound word -->
<p>The German word Donau<wbr>dampf<wbr>schiff<wbr>fahrt</p>

Use Cases

  • Long URLs
  • Technical terms
  • Compound words
  • Strings that might overflow