CSS text-align-lastProperty

CSS Reference


Example

Align the last line of the paragraph to the right:

p { text-align: justify; text-align-last: right; -moz-text-align-last: right; } /*Code for Firefox*/ }

Try it Yourself »

Browser Support

The number in the table indicates the first browser version number that supports this property.

The number specified after -moz- is the first version number prefix that supports this function.

Property
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 takes effect when the text-align property is set to "justify".

Default value: auto
Inherited: Yes
Animatable: No. SeeAnimatable。
version: CSS3
JavaScript Syntax: object.style.textAlignLast="right" Try it Yourself


CSS Syntax

text-align-last: auto|left|right|center|justify|start|end|initial|inherit;

Property value

Value Description Testing
auto Default value. The last line is adjusted and aligned to the left.
left Align the last line to the left.
right Align the last line to the right.
center Align the last line to the center.
justify The last line is justified.
start The last line is aligned at the beginning 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 Set this property to its default value. Seeinitial。
inherit Inherit this property from the parent element. Seeinherit。

CSS Reference

other extensions