HTML5 banner image.

The <wbr> tag in HTML is used to create a Word Break Opportunity. It offers a very fine level of control over where long “words” can break. I came across this tag in a post when I was busy researching how best to deal with long URLs in Word Documents and HTML pages. The <wbr> tag is in a way the opposite of the non-breaking space, &nbsp;

Let us start with some rules around where URLs can be “broken up” between lines:

To achieve the equivalent in a Word document, see Splitting URLs over multiple lines.

  • After a : (colon) or a // (double forward-slash)
  • Before a / (single slash), a ~ (tilde), a . (full stop), a , (comma), a - (hyphen), an _ (underscore), a ? (question mark), a number sign, or a % (percent symbol)
  • Before or after an = (equals sign) or an & (ampersand)

Compare the first paragraph to the paragraph that follows as you resize your browser horizontally:

Link to more information: https://www.businesswritingblog.com/business_writing/2006/06/how_to_urls_and.html

Vs.

Link to more information: https://www.businesswritingblog.com/business_writing/2006/06/how_to_urls_and.html

Note that the above is achieved without adding any punctuations that could be confused as part of the URL itself, for example, a hyphen.


Source: https://www.w3schools.com/tags/tag_wbr.asp

By MisterFoxOnline

CAT Educator

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.