There’s an HTML element for controlling whitespace

July 2, 2020 , I learned...

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:


…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:


Source / Specification