Browse documentation
Reference / Typography
Text wrapping
Balance short headings or ask the browser for more even paragraph endings.
Working example
An atlas of quiet places
A balanced heading needs space to wrap. Constrain its measure and compare the result at several viewport sizes.
<h3 class="max-w-[17ch] text-balance font-serif text-3xl">
An atlas of quiet places
</h3>Class reference
| Class | CSS declarations |
|---|---|
text-wrap | text-wrap: wrap; |
text-nowrap | text-wrap: nowrap; |
text-balance | text-wrap: balance; |
text-pretty | text-wrap: pretty; |
View full generated CSS
.text-balance {
text-wrap: balance;
}
.text-nowrap {
text-wrap: nowrap;
}
.text-pretty {
text-wrap: pretty;
}
.text-wrap {
text-wrap: wrap;
}