On July 2, 2020, I learned...

There’s an HTML element for controlling whitespace

File this under “Obscure HTML Trivia.” Apparently, there’s a <wbr> element and it’s sole duty is to let the browser know it’s welcome to add a line break if it sees an opportunity to use one.

So, some big ol’ string of text like:

<p>Supercalifragilisticexpialidocious</p>

…could be problematic when it comes to starting a new line. That’s where the <wbr> element comes in. We can tell the browser to break that word at a specific spot if it needs to:

<p>Supercalifragilistic<wbr>expialidocious</p>

Source / Specification

(Updated on 7/03/2020)

Leave a Reply

Markdown supported