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 Valueauto
InheritedYes
Applies To
Animation Type
CSS VersionCSS3
StatusStandard

📝 Syntax

text-align-last: auto | start | end | left | right | center | justify;

⚙️ Values

ValueTypeDescription
auto | start | end | left | right | center | justifyKeywordLast line alignment values

▶ Example

Edit the code below and see the live result in the playground:

🌐 Browser Support

Browser ChromeChrome EdgeEdge FirefoxFirefox SafariSafari OperaOpera
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.

📚 Related Tutorials

Web-Tutorial.com

Web-Tutorial Tech Team

A team of developers maintaining programming tutorials. Each tutorial is written and reviewed by developers with expertise in that field. We work to keep our content accurate and reliable — if you spot an issue, please let us know.

100%

🙏 帮我们做得更好

我们是刚上线的编程教程站,几个人的小团队,精力有限。页面虽经检查,难免还有疏漏——链接失效、排版错乱、内容有误、语言生硬……

如果您发现了,麻烦告诉我们,我们会在收到反馈后第一时间进行修复,再次感谢您的光临 🙏