Style textAlignLast Property
Example
Align the last line of a paragraph to the right:
document.getElementById("myDIV").style.textAlignLast="right";
Try it Yourself »
Definition and Usage
The textAlignLast property specifies how to align the last line of a text.
Note:The textAlignLast property only works when the text-align property is set to "justify".
Browser Support
![]()
Only Internet Explorer supports the textAlignLast property.
Firefox supports an alternative property, the MozTextAlignLast property.
Internet Explorer does not support the "start" and "end" values.
Syntax
Return the textAlignLast property:
object.style.textAlignLast
Set the textAlignLast property:
object.style.textAlignLast="auto|left|right|center|justify|start|end|initial|inherit"
Property Values
| Value | Description |
|---|---|
| auto | Default value. The last line is adjusted and aligned to the left. |
| left | The last line is aligned to the left. |
| right | The last line is aligned to the right. |
| center | The last line is aligned to the center. |
| justify | The last line is adjusted to justify. |
| start | The last line is aligned at the start of the line (left-aligned if text-direction is left-to-right, right-aligned if text-direction is right-to-left). |
| end | The last line is aligned at the end of the line (right-aligned if text-direction is left-to-right, left-aligned if text-direction is right-to-left). |
| initial | Sets this property to its default value. Seeinitial。 |
| inherit | Inherits this property from its parent element. Seeinherit。 |
Technical Details
| Default value: | auto |
|---|---|
| Return value: | A string, representing the element's text-align-last property. |
| CSS Version | CSS3 |
Related Articles
CSS Reference:text-align-last property
Other Extensions
Style Object