text-align-last CSS propertyThe text-align-last CSS property sets how the last line of a block or a line, right before a forced line break, is aligned.
text-align-last: right;text-align-last: center;text-align-last: left;<section id="default-example">
<div>
<p id="example-element">
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
aliquip ex ea commodo consequat.
</p>
</div>
</section>section {
font-size: 1.5em;
}
#default-example > div {
width: 250px;
}
#example-element {
text-align: justify;
}/* Keyword values */
text-align-last: auto;
text-align-last: start;
text-align-last: end;
text-align-last: left;
text-align-last: right;
text-align-last: center;
text-align-last: justify;
/* Global values */
text-align-last: inherit;
text-align-last: initial;
text-align-last: revert;
text-align-last: revert-layer;
text-align-last: unset;This property is specified as one of the following keyword values:
autoThe affected line is aligned per the value of text-align, unless text-align is justify, in which case the effect is the same as setting text-align-last to start.
startThe same as left if direction is left-to-right and right if direction is right-to-left.
endThe same as right if direction is left-to-right and left if direction is right-to-left.
leftThe inline contents are aligned to the left edge of the line box.
rightThe inline contents are aligned to the right edge of the line box.
centerThe inline contents are centered within the line box.
justifyThe text is justified. Text should line up their left and right edges to the left and right content edges of the paragraph.
| Initial value | auto |
|---|---|
| Applies to | block containers |
| Inherited | yes |
| Computed value | as specified |
| Animation type | discrete |
text-align-last =
auto |
start |
end |
left |
right |
center |
justify |
match-parent
p {
font-size: 1.4em;
text-align: justify;
text-align-last: center;
}