css text-wrap:balance for pretty little blurbs
3/4 in the series: makin the blog
- first post! testing... - Nov 29, 2025
- jekyll series premiere - Dec 13, 2025
- css text-wrap:balance for pretty little blurbs - Dec 21, 2025
- running bash commands in jekyll (plus git commit info) - Dec 27, 2025
Found a somewhat-recent (2024) nice little CSS feature for balanced text-wrapping.
I am by no means a CSS expert. I know just enough to have an idea of what should be possible, and drive myself insane trying to figure out how to do it.
I was working on adding next/previous post links to the bottom of the blog post layout, and I came across this feature which I think makes it look a lot nicer.
The next-post link is right aligned with a little right-arrow ⇒ after the title. If the screen is shrunken just right, then the arrow ends up on its own line, which looks ugly. This tries to balance the number of characters per line. It’s apparently computationally more intensive for browsers and limited to a handful of lines. But this is exactly the use case I imagine it would be for
examples
some quick inline CSS examples
without text-wrap: balance;
with text-wrap: balance;
conclusion
Here’s a screenshot from the blog on a simulated Iphone SE:

Or see it action by scrolling to the bottom of this page and making the window smaller.