Browse documentation

Reference / Typography

Text wrapping

Balance short headings or ask the browser for more even paragraph endings.

Working example

A balanced heading needs space to wrap. Constrain its measure and compare the result at several viewport sizes.

HTML
<h3 class="max-w-[17ch] text-balance font-serif text-3xl">
  An atlas of quiet places
</h3>

Class reference

ClassCSS declarations
text-wraptext-wrap: wrap;
text-nowraptext-wrap: nowrap;
text-balancetext-wrap: balance;
text-prettytext-wrap: pretty;
View full generated CSS
Compiled CSS
.text-balance {
  text-wrap: balance;
}
.text-nowrap {
  text-wrap: nowrap;
}
.text-pretty {
  text-wrap: pretty;
}
.text-wrap {
  text-wrap: wrap;
}