💥 This CSS parameter WILL level up your web typography!
Yesterday I was doomscrolling through X and saw a Chrome team post about a neat CSS trick: text-wrap: balance
This is't something new, as the post dated 2024, but it's definitely something I and probably you missed as well.
This parameter solves a pretty annoying problem:
Most of us still manually add <br> tags or tweak widths to stop those awkward “extra-long / super-short” lines in headlines.
The browser does does some computations to find the perfect balance.
Based on the doc the chrome team shared, the algo considers font size, language, container width, and doing advanced math to make website text prettier.
A few things to know:
→ Works on blocks up to 6 lines
→ Don’t use it on everything (it can slow your page)
→ Great for headlines, quotes, and card titles
---
🧠 Thoughts are mine
🤖 Edited by AI