text-align-last property
Last updated: 2026-09-13
text-align-last text-align-last property
The text-align-last CSS property sets the alignment of the last line inside a block-level element, most often paired with text-align: justify. By default the alignment rules of text-align do not apply to a paragraph's last line; text-align-last lets you control that last line separately for more flexible, attractive justified layouts.
| Category | |
|---|---|
| Initial Value | auto |
| Inherited | Yes |
| Applies To | |
| Animation Type | |
| CSS Version | CSS3 |
| Status | Standard |
📝 Syntax
text-align-last: auto | start | end | left | right | center | justify;
⚙️ Values
| Value | Type | Description |
|---|---|---|
auto | start | end | left | right | center | justify | Keyword | Last line alignment values |
▶ Example
Edit the code below and see the live result in the playground:
🌐 Browser Support
| Browser | |||||
|---|---|---|---|---|---|
| text-align-last | ✓ v43 | ✓ v12 | ✓ v49 | ✓ v9 | ✓ v30 |
| Supported in all major browsers | |||||
Tip: auto makes the last line follow the value of text-align; if text-align is justify, the last line aligns left.
Warning: text-align-last is only visible when the element has multiple lines; a single line shows no change.
❓ FAQ
QHow are the text-align-last and text-align properties related?
Atext-align controls the alignment of every line except the last, and text-align-last controls the alignment of the final line specifically. Used together they enable finer typographic control over a block of text.
QWhy is my text-align-last property not working as expected in CSS?
ACheck that the element has multiple lines of text and that text-align is set to justify. If the text is a single line, text-align-last produces no visible effect.
QHow do I center the last line of a paragraph with text-align-last?
AFirst set text-align: justify so the body aligns flush on both edges, then set text-align-last: center so the final line is centered. Note it only works on multi-line text; for a single line, just use text-align: center.