Latest web development tutorials
 

Style textAlignLast Property

< Style Object

Example

Align the last line of a pragraph 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 will only work for elements with the text-align property set to "justify".


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The textAlignLast property is only supported in Internet Explorer.

Firefox supports an alternative, the MozTextAlignLast property.

The values "start" and "end" are not supported in Internet Explorer.


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 justified and aligned left
left The last line is aligned to the left
right The last line is aligned to the right
center The last line is center-aligned
justify The last line is justified as the rest of the lines
start The last line is aligned at the beginning of the line (left if the text-direction is left-to-right, and right is the text-direction is right-to-left)
end The last line is aligned at the end of the line (right if the text-direction is left-to-right, and left is the text-direction is right-to-left)
initial Sets this property to its default value. Read about initial
inherit Inherits this property from its parent element. Read about inherit

Technical Details

Default Value: auto
Return Value: A String, representing the text-align-last property of an element
CSS Version CSS3

Related Pages

CSS reference: text-align-last property


< Style Object