text-align-all
Limited availability45% of users
Controls text alignment for all lines, including the last. More restrictive version of text-align.
What's modern
From web-features, MDN's browser data and our snippets, checked dailyComingNot in any major browser yet under this name.
See how modern your own CSS is.Check your CSS →
Quick example
p { text-align-all: center; }Examples
Justify all lines including the last
.justified {
text-align: justify;
text-align-last: justify;
}
/* All lines, even the last line, stretch to full width */Extend justification to the last line for magazines and print-like layouts.
Center-align the last line of a paragraph
p {
text-align: justify;
text-align-last: center;
}Keep justified alignment for all lines except center the final line.
Common pitfalls
- Justification can look awkwardJustified text with wide word spacing can look unnatural, especially on narrow screens. Pair with hyphens: auto for better results.
- Last-line only affects the last linetext-align-last only affects the final line of the block. If the block has only one line, only that property applies.
text-align-all browser support
BaselineLimited availabilityThis feature is not Baseline because it does not work in some of the most widely-used browsers.Not ready for production without a fallback.
Usage45%of people can use this55% use a browser without it.