Force text to break when spaces are not present

word-break

Prevent text that has no spaces from overflowing the element's boundaries.

Property values

This property controls whether long stretches of text that have no spaces should overflow the element's right edge or should be abruptly continued on the next line.

East Asian scripts (Chinese, Japanese, Korean) continue flowing from line to line without needing spaces.

Some South Asian scripts (Thai) do not use spaces between words, but do use spaces at the end of a sentence.

The need for the word-break property in Latin scripts (English), is limited to things like URLs and chemical formulas.

Specify one of these keyword values:

keyword break at space when necessary break in the middle of string
normal yes no
break-all no yes
keep-all no no
break-word yes yes

Examples

/* Use this with long URLs */            
word-break: break-all;
word-break
0

style > character > word-breakForce text to break when spaces are not present

🔗 🔎