text-align-all

Controls text alignment for all lines, including the last. More restrictive version of text-align.

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.

text-align-all Browser Support

Limited availability 45% global usage

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Not ready for production without a fallback.

Common pitfalls

Justification can look awkward

Justified 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 line

text-align-last only affects the final line of the block. If the block has only one line, only that property applies.

ESC