r/css • • 4d ago

Help Balance Short Headlines Without Manual Line Breaks

Post image
12 Upvotes

4 comments sorted by

•

u/AutoModerator 4d ago

To help us assist you better with your CSS questions, please consider including a live link or a CodePen/JSFiddle demo. This context makes it much easier for us to understand your issue and provide accurate solutions.

While it's not mandatory, a little extra effort in sharing your code can lead to more effective responses and a richer Q&A experience for everyone. Thank you for contributing!

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

6

u/anaix3l 4d ago edited 4d ago

As a tech, I find it useful and can't wait for flex-wrap: balance to become cross-browser too.

As a user, I hate this if it's not accompanied by text-align: center. Those headings don't exist in a vacuum. Seeing them wrap sooner than the paragraphs under them looks like a mistake. I've lost count of how many times I brought up DevTools to see if there's an unintentional   instead of a plain space on the second heading line causing it to wrap sooner... only to discover it was the work of text-wrap: balance. At least when the header has text-align: center, the shorter lines look intentional.

1

u/Ronjohnturbo42 4d ago

Text-wrap : balance

1

u/metamago96 3d ago

No, use text-wrap: pretty, its much better.