CSS text-align-last Property
Example
Align the last line of a paragraph to the right:
p {
text-align: justify;
text-align-last: right;
-moz-text-align-last: right; /* Code for Firefox */
}
Browser Support
The numbers in the table specify the first browser version that fully supports the property.
Numbers prefixed with -moz- specify the first version that supported the function with that prefix.
| Property | Chrome | IE | Firefox | Safari | Opera |
|---|---|---|---|---|---|
| text-align-last | 47.0 | 5.5 | 12.0 -moz- | Not supported | 34.0 |
Definition and Usage
The text-align-last property specifies how to align the last line of text.
Note: The text-align-last property only works when text-align is set to "justify".
| Default value: | auto |
|---|---|
| Inherited: | Yes |
| Animatable: | No. See animatable |
| Version: | CSS3 |
| JavaScript syntax: | object.style.textAlignLast="right" Try it |
CSS Syntax
Property Values
| Value | Description | Demo |
|---|---|---|
| auto | Default value. The last line is adjusted and aligned to the left. | Demo » |
| left | The last line is aligned to the left. | Demo » |
| right | The last line is aligned to the right. | Demo » |
| center | The last line is centered. | Demo » |
| justify | The last line is adjusted to justify. | Demo » |
| start | The last line is aligned at the start of the line (left if text-direction is left-to-right, right if text-direction is right-to-left). | Demo » |
| end | The last line is aligned at the end of the line (right if text-direction is left-to-right, left if text-direction is right-to-left). | Demo » |
| initial | Sets this property to its default value. See initial | Demo » |
| inherit | Inherits this property from its parent element. See inherit |