DEV Community

Discussion on: HTML Features, probably you never knew existed.

Collapse
 
chuniversiteit profile image
Chun Fei Lung

Hey, nice list!

The <wbr> elements in your first example don’t do anything useful though, because browsers already handle line breaks between words automatically. As the name “word break” implies, it’s meant for introducing breaks within words, or things that might be treated as a single word, like very long URLs.

Collapse
 
codereaper08 profile image
Vishwa.R

Thanks @chuniversiteit !
Good point, regarding long URLs. Will surely note it :-)

Collapse
 
priitpu profile image
Priit

Browsers handle line breaks between words and syllables automatically, provided there's a grammar package for the language you have defined in your HTML tag. Might be useful for content managers in languages where automatic hyphenation or word breaking doesn't work. An alternative would be to use a soft hyphen character (compart.com/en/unicode/U+00AD) which also suggests a word break possibility for the browser.

Collapse
 
codereaper08 profile image
Vishwa.R

Hey @priitpu !
Thanks for commenting :-)
I never knew about soft-hyphen thing, thanks for letting me know.