Style textAlignLast property

Definition and Usage

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

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

See also:

CSS Reference Manual: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 that of setting start.

left The last line is aligned to the left.
right The last line is aligned to the right.
center The last line is centered.
justify The last line is aligned like the other lines (both ends).
start The last line of the text is aligned at the beginning of the line (if the text direction is from left to right, it is aligned to the left, and if the text direction is from right to left, it is aligned to the right).
end The last line of the text is aligned at the end of the line (if the text direction is from left to right, it is aligned to the right, and if the text direction is from right to left, it is aligned to the left).
initial Set this property to its default value. Angalia initial.
inherit Ina继承此属性 kutoka kwa elementi yake wa mazingira. Angalia inherit.

Technical details

Default value: auto
Return value: string, inaonyesha ya text-align-last property.
CSS version: CSS3

browseri inahimizaji

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Mwongozo Mwongozo Haitumiwa
Tafadhali tukabidhi
MozTextAlignLast
Mwongozo Mwongozo