CSS: overflow-wrap
overflow-wrap
This is useful because often you have long url, and on mobile phone small screen, it'll create horizontal scroll. To fix, add
overflow-wrap: anywhere.
overflow-wrap: normal-
default.
overflow-wrap: anywhere-
force display a line break for long words, such as long URL.
pre, code, h1, s, a, { overflow-wrap: anywhere; } /* in h1 because you may have a long joined word e.g. Number.prototype.toLocaleString and when in large font and on phone screen it causes horizontal scroll. */ overflow-wrap: break-word-
same as
overflow-wrap: anywherebut the value of the element's intrinsic width is not changed, and this has an effect when you usewidth: min-content. (as if you haveoverflow-wrap: normal).
History
The property was originally a nonstandard Microsoft creation
called word-wrap.
It is renamed to overflow-wrap by CSS standard.