Use the following css snippets for better text wrapping. More info:
- https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/text-wrap
- https://developer.chrome.com/blog/css-text-wrap-pretty
For headings
Creates a harmonious text block, but it does not prevent orphans:
text-wrap: balance;Code language: HTTP (http)
For body text
This prevents orphans (single words) on the last line. More info:
text-wrap: pretty;Code language: HTTP (http)
Divi
Divi 5.8.1 added a setting for this to the text, heading and title option groups.
An alternative is to add the CSS in the theme options custom css to apply to all Divi modules.
/* START improve text wrapping */
h1, h2, h3, h4, h5, h6{
text-wrap: balance;
}
p{
text-wrap: pretty;
}
/* END improve text wrapping */Code language: CSS (css)