W3cubDocs

/CSS

text-align-last

Thetext-align-last CSS property describes how the last line of a block or a line, right before a forced line break, is aligned.

Syntax

/* 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: unset;

Values

auto
The 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.
start
The same as left if direction is left-to-right and right if direction is right-to-left.
end
The same as right if direction is left-to-right and left if direction is right-to-left.
left
The inline contents are aligned to the left edge of the line box.
right
The inline contents are aligned to the right edge of the line box.
center
The inline contents are centered within the line box.
justify
The text is justified. Text should line up their left and right edges to the left and right content edges of the paragraph.

Formal syntax

auto | start | end | left | right | center | justify

Example

p {
  font-size: 1.4em;
  text-align: justify;
  text-align-last: center;
}

Specifications

Specification Status Comment
CSS Text Module Level 3
The definition of 'text-align-last' in that specification.
Working Draft Initial definition
Initial value auto
Applies to block containers
Inherited yes
Media visual
Computed value as specified
Animation type discrete
Canonical order the unique non-ambiguous order defined by the formal grammar

Browser compatibilityUpdate compatibility data on GitHub

Desktop
Chrome Edge Firefox Internet Explorer Opera Safari
Basic support 47
47
35 — 47
Disabled
Disabled From version 35 until version 47 (exclusive): this feature is behind the Enable Experimental Web Platform Features preference (needs to be set to true). To change preferences in Chrome, visit chrome://flags.
12 49
49
12 — 53
Prefixed
Prefixed Requires the vendor prefix: -moz-
Partial
Partial
IE only supports text-align-last when text-align is set to justify.
The start and end values are not supported.
Yes No
No
See WebKit bug 76173.
Mobile
Android webview Chrome for Android Edge Mobile Firefox for Android Opera for Android iOS Safari Samsung Internet
Basic support 47
47
37 — 47
Disabled
Disabled From version 37 until version 47 (exclusive): this feature is behind the Enable Experimental Web Platform Features preference (needs to be set to true).
47
47
35 — 47
Disabled
Disabled From version 35 until version 47 (exclusive): this feature is behind the Enable Experimental Web Platform Features preference (needs to be set to true). To change preferences in Chrome, visit chrome://flags.
Yes 49
49
14 — 53
Prefixed
Prefixed Requires the vendor prefix: -moz-
Yes No
No
See WebKit bug 76173.
5.0

See also

© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/CSS/text-align-last