CSS text-align-last Property

❮ Previous Reference Next ❯

Example

.example1 {
  text-align-last: center;
}

.example2 {
  text-align-last: left;
}

.example3 {
  text-align-last: right;
}

.example4 {
  text-align-last: justify;
}





Hello World!

Lorem Ipsum is simply dummy text of the printing and typesetting industry.

Lorem Ipsum is simply dummy text of the printing and typesetting industry.


Meaning

The text-align-last property sets how the last line of a block or a line, right before a forced line break, is aligned.

Default value:auto
Inherited:Yes
Animatable:No
Version:CSS3
JavaScript syntax:
object.style.textAlignLast="auto|left|right|center|justify|start|end|initial|inherit|revert|revert-layer|unset";



Standard Syntax

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



Browser Support

The numbers in the table specify the first browser version that fully supports the property.




Status







Property Values

The following table describes the values of this property.

Value Description
auto This is default value. The last line is justified and aligned left.
left Specifies that the last line is aligned to the left.
right Specifies that the last line is aligned to the right.
center Specifies that the last line is center-aligned
justify Specifies that the last line is justified as the rest of the lines.
start Specifies that the last line is aligned at the beginning of the line.
end Specifies that the last line is aligned at the end of the line.
initial Sets this property to its default value.
inherit If specified, the associated element takes the computed value of its parent element animation-delay property.
revert Reverts the cascaded value of the property from its current value to the value the property
revert-layer Rollback styles to the ones specified in previous cascade layers.
unset Resets a property to its inherited value if the property naturally inherits from its parent, and to its initial value if not.



Default CSS Property Values

selectors {
  text-align-last: auto;
}
❮ Previous Reference Next ❯