CSS text-wrap-style: pretty for Long-Form Paragraphs

Pretty paragraph wrapping without orphan words

Long paragraphs often end with one short word on the last line. The old fix was a non-breaking space hand-placed in the copy. text-wrap-style: pretty tells the browser to avoid orphans across the whole paragraph.

Old way Hand-edited copy
article p   {  text-wrap: wrap;}/* default browser line-breaking, single-word last lines stay
1 property
article p   {  text-wrap: pretty;}/* no orphan words on the last line
Newly available Since 2024 84% global usage

Since 2024 this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

Works in all modern browsers. May need a fallback for older browsers.

130+
124+
17.5+
130+

The text-wrap-style property is Baseline Newly Available since 2024, but the pretty value specifically has not shipped in Firefox yet. Chrome and Edge support it from version 130, Safari from 17.5 (with a refined algorithm in 26). Firefox falls back to default wrapping with no layout breakage, so treat pretty as progressive enhancement.

Drag the right edge to resize and watch text-wrap-style: pretty rebalance the last line

The author wrote a long sentence about paragraph endings and the typographic tradition of avoiding a stranded final word.

Drag the right edge to resize. The paragraph uses text-wrap-style: pretty, so the browser keeps the last line from being orphaned as the width changes. Effect visible only in Chrome 130+, Edge 130+, or Safari 17.5+. Firefox falls back to default wrap.

No copy edits

No more hunting for last-line orphans and patching with  . The browser rebalances the whole paragraph.

Different from balance

balance is for short blocks like headlines. pretty is for long-form body text where only the tail needs help.

Graceful fallback

Browsers without the pretty value fall back to default wrapping. No layout breakage, just no enhancement.

Old Approach
Hand-edited copy
Non-breaking spaces in CMS
Modern Approach
text-wrap-style: pretty
Browser rebalances tails

How it works

Long paragraphs often look fine until the last line, which ends with a single short word (a runt). The traditional fix was to find each one and insert a non-breaking space between the last two words in the source copy. That works once, but breaks the moment the container resizes or the copy changes.

text-wrap-style: pretty (or the shorthand text-wrap: pretty) tells the browser to consider the whole paragraph when breaking lines. It will pull a word back from earlier lines if doing so removes a single-word last line. Use it on body copy: article p, .prose p, blog post content. Avoid it on huge paragraphs in performance-critical paths because the algorithm is slower than default wrapping.

pretty and balance solve different problems. Use balance on headlines and short blocks (a few lines), where you want even line lengths. Use pretty on long-form text, where you only want to clean up the last line. Don't use both on the same element.

ESC