Typography Beginner

Balanced headlines without manual line breaks

You used to add br tags by hand or pull in Balance-Text.js. Now one property evens out lines so headlines don't end with a single word.

4 lines
1h1, h2 {
2  text-wrap: balance;
3  max-width: 40ch;
4}
Old 8 lines
1/* HTML: manual <br> or wrapper for JS */
2h1 {
3  text-align: center;
4  max-width: 40ch;
5  /* Balance-Text.js: script + init */
6  /* or insert <br> in CMS/HTML */
7}
Newly available Since 2023 87% global usage

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

114+
121+
17.4+
114+
compare balanced vs unbalanced
UNBALANCED

This headline wraps awkwardly leaving one word on the last line

BALANCED

This headline wraps awkwardly leaving one word on the last line

Kinsta

Your first month is free

Managed WordPress hosting for faster sites.

Learn more
⚑

No scripts

Drop Balance-Text or any JS. The browser balances lines natively.

✦

No manual br tags

Works with any content width. No CMS hacks or hand-placed line breaks.

∞

Performance

Layout happens in the engine. No DOM reads or resize observers.

Lines Saved
7 β†’ 4
No JS, no br
Old Approach
Manual br or JS lib
Balance-Text, CMS hacks
Modern Approach
One property
Native text-wrap: balance

How it works

Headlines often wrapped with one word on the last line. The old fix was either manual <br> tags (brittle when copy changes) or a script like Balance-Text that measured and reflowed after paint.

text-wrap: balance tells the browser to prefer more even line lengths. It works best on short blocks (a few lines). No script, no DOM access, just layout.

New CSS drops.

Join 600+ readers who've survived clearfix hacks.

ESC