Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

CSS text-align-last property

CSS text-align-last property

CSS Reference Manual CSS Reference Manual

Example

Align the last line of a paragraph to the right:

p

{

text-align:

justify

;

text-align-last:

right

; -

moz-text-align-last:

right

;

}

/*

Code for Firefox

*/

}

Try it »


Browser support

The numbers in the table indicate the first browser version that supports this property.

The number specified after -moz- is the prefix of the first version number that supports the 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 takes effect only when the text-align property is set to "justify".

Default value: auto
Inherited: Is
Animatable: No. See Animatable.
Version: CSS3
JavaScript syntax: object.style.textAlignLast="right" Try it

CSS Syntax

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

Attribute values

Value Description Testing
auto Default. The last line is adjusted and aligned to the left. Test »
left The last line is aligned to the left. Test »
right The last line is aligned to the right. Test »
center The last line is centered. Test »
justify The last line is adjusted to be justified. Test »
start The last line is aligned at the start of the line (aligned left if text-direction is left-to-right; aligned right if text-direction is right-to-left). Test »
end The last line is aligned at the end of the line (aligned right if text-direction is left-to-right; aligned left if text-direction is right-to-left). Test »
initial Sets this property to its default value. See initial. Test »
inherit Inherits this property from its parent element. See inherit.

CSS Reference Manual CSS Reference Manual