text-wrap: balance vs pretty Preview
Two panes show the same text side by side: the left uses the default text-wrap: wrap, the right uses the property you choose. Type your own headline or sentence, drag the container width, and watch where the lines break. A note beneath tells you whether your browser supports the value you picked, so you know if the right pane is a real rendering or just a copy of the left.
How to compare text wrapping
- Choose a value under Compare default against: balance, pretty or nowrap.
- Edit Your text. If you clear the box, the panes fall back to the sample headline.
- Drag Container width between 180 and 640px. Both panes use the same max-width.
- Read the support note. If your browser lacks the value, both panes look identical.
- Click Copy to take the CSS rule. Balance and nowrap target
h1, h2, h3, pretty targetsp, li, and each includes the width you previewed.
Which value to use where
text-wrap: balance tries to even out line lengths so a heading does not end with one short word dangling. Browsers only balance a limited number of lines, so it suits headings, captions and short blurbs, not long paragraphs. Try it in the preview by narrowing the container until the default pane leaves a short last line, then compare the right pane.
text-wrap: pretty targets body copy. It mainly steers the layout away from orphans (a lone word on the last line) and may adjust earlier breaks to do so, at the cost of extra layout work. Its effect is subtle and usually limited to the final lines, so when you pick it the preview switches both panes to smaller regular-weight type that reads like a paragraph rather than a headline.
Neither value changes the text or your width, only where lines break, so they are safe progressive enhancement: unsupported browsers fall back to normal wrapping and the layout still works. nowrap is included for contrast. It forces one line and can overflow its container, so it belongs on short labels, not readable copy.