8 days ago · Tech · 0 comments

## Part 2: A Slightly Smarter Wrap In the last post, we talked about `text-wrap: balance` and how it makes headings feel cleaner and easier to read. Where `balance` is perfect for making your headings feel cleaner and a little easier to read, `pretty` is here to make paragraphs feel _just right_. In short: `text-wrap: pretty` helps make sure the last sentences in paragraphs don't end up with an orphaned word or two on their last line. ## What is text-wrap: pretty? `text-wrap: pretty` is a newer CSS value that tells the browser to avoid awkward line breaks when wrapping text. Instead of just filling lines as efficiently as possible, the renderer uses an algorithm to make better decisions about where lines should break, rather than the default behavior, which uses the "play it as it lies" approach you're probably familiar with. Fundamentally, it means fewer orphaned words at the end of paragraphs, and fewer cases where multiple consecutive lines have hyphenated breaks. It is subtle, but…

No comments yet. Log in to reply on the Fediverse. Comments will appear here.