CSS property text-wrap
The text-wrap
property is default value wrap
. However, it can also also be balance
and pretty
.
balance
will attempt to split the number of words on each line so that they are close to equal. This can be quite useful for heading element, like <h1>
elements. balance
is faily well supported across current browser.
pretty
is similar to wrap
but will avoid single-word orphans on the final line. pretty
is supported in Chrome/Edge and Opera, but not in Firefox/Safari. However, due to the implementation of prettier
, the default of wrap
when unsupported is an acceptable fallback implementation.