text-align-last
Controls the alignment of the last line in justified (text-align: justify) text. Also applies to regular text, but primarily used with justify.
Class List
| Class | CSS | Description |
|---|---|---|
taln | text-align-last: auto | Browser default. Follows the text-align property |
tall | text-align-last: left | Align last line to the left |
talr | text-align-last: right | Align last line to the right |
talc | text-align-last: center | Center the last line |
talj | text-align-last: justify | Justify the last line as well |
Visual Comparison
Compares how the last line is aligned in justified text.
auto (default value) — taln
The East Sea and Baekdu Mountain, until they are dry and worn away, God protect our nation forever. Mugunghwa three thousand ri, splendid rivers and mountains.
left — tall
The East Sea and Baekdu Mountain, until they are dry and worn away, God protect our nation forever. Mugunghwa three thousand ri, splendid rivers and mountains.
right — talr
The East Sea and Baekdu Mountain, until they are dry and worn away, God protect our nation forever. Mugunghwa three thousand ri, splendid rivers and mountains.
center — talc
The East Sea and Baekdu Mountain, until they are dry and worn away, God protect our nation forever. Mugunghwa three thousand ri, splendid rivers and mountains.
justify — talj
The East Sea and Baekdu Mountain, until they are dry and worn away, God protect our nation forever. Mugunghwa three thousand ri, splendid rivers and mountains.
Usage Examples
<!-- Justify + center last line -->
<p class="taj talc">
The last line of long text is centered.
The effect is visible in multi-line paragraphs.
</p>
<!-- Justify + right-align last line -->
<p class="taj talr">
The last line is right-aligned.
Useful for signatures or date displays.
</p>Tips & Notes
Use with taj
text-align-last is most useful when combined with taj (text-align: justify). Allows separate alignment for the last line.