Style textAlignLast Property

Definition and Usage

textAlignLast This property specifies how to align the last line of the text.

Note:textAlignLast This property is only applicable when the text-align property is set to "justify" elements.

See also:

CSS Reference Manual:The text-align-last property

Example

Align the last line of the paragraph to the right:

document.getElementById("myDIV").style.textAlignLast = "right";

Try It Yourself

Syntax

Return textAlignLast Property:

object.style.textAlignLast

Set textAlignLast Property:

object.style.textAlignLast = "auto|left|right|center|justify|start|end|initial|inherit"

Property Value

Value Description
auto

Default value. The alignment rule for each line is determined by the value of text-align.

When the value of text-align is justify, the behavior of text-align-last is the same as setting start.

left Aligns the last line of the text to the left.
right Aligns the last line of the text to the right.
center Aligns the last line of the text to the center.
justify Aligns the last line of the text with the rest of the lines (both ends).
start Aligns the last line of the text to the beginning of the line (if the text direction is from left to right, it is left-aligned, and if the text direction is from right to left, it is right-aligned).
end Aligns the last line of the text to the end of the line (if the text direction is from left to right, it is right-aligned, and if the text direction is from right to left, it is left-aligned).
initial Sets this property to its default value. See initial.
inherit Inherits this property from its parent element. See inherit.

Technical Details

Default value: auto
Return value: A string that represents the alignment of the The text-align-last property.
CSS Version: CSS3

Browser Support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support Support Not Supported
Please Use
MozTextAlignLast
Support Support