Table of contents
- 1. Summary
- 2. Syntax
- 3. Values
- 4. Examples
- 5. Browser compatibility
- 6. Specifications
- 7. See also
« CSS « CSS Reference
Summary
The text-align-last CSS property describes how the last line of a block or a line, right before a forced line break, is aligned.
- Initial value
:
auto - Applies to: block level elements
- Inherited : yes
- Media:
visual - Computed value : as specified
Syntax
text-align-last: auto | start | end | left | right | center | justify | inherit
Values
- auto
- The affected line is aligned per the value of
text-align. - start
- The same as
leftif direction is left-to-right andrightif direction is right-to-left. - end
- The same as
rightif direction is left-to-right andleftif direction is right-to-left. - left
- The inline contents are aligned to the left edge of the line box.
- right
- The inline contents are aligned to the right edge of the line box.
- center
- The inline contents are centered within the line box.
- justify
- The text is justified. Text should line up their left and right edges to the left and right content edges of the paragraph.
Examples
div {
text-align: justify;
-moz-text-align-last: center;
text-align-last: center;
}
Browser compatibility
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
|---|---|---|---|---|---|
| Basic support | -- WebKit bug 76173 | 12.0 (12.0) -moz | 5.5 | -- | -- WebKit bug 76173 |
| Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|
| Basic support | -- WebKit bug 76173 | 12.0 (12.0) -moz | 6.0 | -- | -- WebKit bug 76173 |
In Internet Explorer, the start and end values are not supported.
Specifications
| Specification | Status | Comment |
|---|---|---|
| CSS Text Module Level 3 | Working Draft |


Mozilla Developer Network