DEV Community

Discussion on: 7 cases where we can use HTML instead of CSS

Collapse
 
ludamillion profile image
Luke Inglis • Edited

<wbr> says "you can break here if you need to" to be used with a particularly long word or if a phrase will make more sense if it breaks at a certain point.

Also handy if you are displaying a URL or similar type of string and you want to make sure it breaks at a meaningful/convenient place like a '/'.

Collapse
 
riidom profile image
riidom

You don't get a hyphen though, which you want when you break up a long word. I'd rather use &shy; here. <wbr> looks more useful for URLS, imo.

Collapse
 
grahamthedev profile image
GrahamTheDev

+1 to that!

URLs and German (with the beautiful mega long words that break your UI when you try to implement i18n!)...I am sure that is what <wbr> was designed for, just those two use cases! 😋

Thread Thread
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️

Nah, pretty sure URLs were an afterthought. <wbr> was added just for German i18n.

Thread Thread
 
roelroel profile image
Roel de Brouwer

Or Dutch. But in the Netherlands many people have the English disease where they write spaces when they should not. Sometimes this unintentionally totally changes the meaning of a sentence. F.e. "zoete witte wijnprofessor".

Thread Thread
 
dannyengelman profile image
Danny Engelman

Niets mis mee.
Is een blanke vinoloog die universiteitsstudentjes wat zijig lesgeeft