I am looking for a list of caracters and elements that may break HTML lines such as whitespaces but I can't find any page on the Internet with a definition of what is the normal HTML line break behavior. I have found those :
- divisable space,
- tab,
- new line
- Zero-width space (asian)
- less "-"
- Soft-hyphen
I am not expecting it to break in the "pre" tag, of course!
If I understand correctly, you want to know what characters create a soft wrap opportunity, that is, they allow a line break in order to fit the content within the measure.
The answer is that it's not fully defined, and depends on the language:
You can partially control this behavior using some CSS properties like
line-break
, to specify how wrapping interacts with punctuation and symbolsword-break
, which may allow soft wrap opportunities between lettershyphens
, to control whether hyphenation is allowed to create more soft wrap opportunitiesoverflow-wrap
/word-wrap
, which may allow arbitrary breaks within a word to prevent overflowIf you want the full list of characters that create a soft wrap opportunity, you can use JS: