# Nicer Line Breaks in Paragraphs and Headings

> Avoids single orphan words on the last line of paragraphs and balances heading lines, using modern CSS text wrapping, for more polished typography.

- Type: CSS
- Runs: Site-wide header
- Category: [Frontend & Design](https://wpide.com/library/category/frontend/)
- Tags: typography, readability, css
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/frontend-pretty-text-wrapping/

## Code

```css
p,
li,
figcaption,
blockquote {
    text-wrap: pretty;
}

h1,
h2,
h3,
h4,
.wp-block-post-title {
    text-wrap: balance;
}
```

## Notes

Browsers without support simply wrap text as usual.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Nicer Line Breaks in Paragraphs and Headings" in its snippet library and add it in one click; or create a new CSS snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
