This is an experimental technology
Because this technology's specification has not stabilized, check the compatibility table for usage in various browsers. Also note that the syntax and behavior of an experimental technology is subject to change in future versions of browsers as the specification changes.
Summary
The text-align-last CSS property describes how the last line of a block or a line, right before a forced line break, is aligned.
| 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 |
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, unlesstext-alignisjustify, in which case the effect is the same as settingtext-align-lasttoleft. start- The same as
leftif direction is left-to-right andrightif direction is right-to-left. end- The same as
rightif direction is left-to-right andleftif 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
Examples
div {
text-align: justify;
-moz-text-align-last: center;
text-align-last: center;
}
Specifications
| Specification | Status | Comment |
|---|---|---|
| CSS Text Level 3 The definition of 'text-align-last' in that specification. |
Working Draft | Initial definition |
Browser compatibility
| Feature | Chrome | Edge | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
|---|---|---|---|---|---|---|
| Basic support | 35[1] 47 |
(Yes) | 12.0 (12.0)-moz 49.0 (49.0)[2] |
5.5[3] | No support | No support[4] |
| Feature | Android | Edge | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|---|
| Basic support | No support[1] | (Yes) | 12.0 (12.0)-moz 49.0 (49.0)[2] |
6.0[3] | No support | No support[1] |
[1] Enabled through the "Enable Experimental Web Platform Features" flag in chrome://flags.
[2] In Gecko 53 (Firefox 53.0 / Thunderbird 53.0 / SeaMonkey 2.50) the -moz prefixed version of the property got removed.
[3] In Internet Explorer, the start and end values are not supported.
[4] See WebKit bug 76173.
See also
Document Tags and Contributors
Tags:
Contributors to this page:
erikadoyle,
Sebastianz,
yisibl,
fscholz,
SJW,
yisi,
kscarfone,
nabsltd,
Sheppy,
ethertank,
teoli,
metavida,
Marcoos
Last updated by:
erikadoyle,
