text-align-last property CSS Reference



Definition and Usage

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 auto
  • Applies to block containers
  • Inherited yes
  • Media visual
  • Computed Value as specified
  • Animatable no
  • Canonical order the unique non-ambiguous order defined by the formal grammar

Syntax

Formal syntax: auto | start | end | left | right | center | justify
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
text-align-last: inherit

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 left.
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.

Examples

div {
text-align: justify;
-moz-text-align-last: center;
text-align-last: center;
}

Compatibility

Desktop browsers

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support Not supported
(WebKit bug 76173)
12.0 (12.0)-moz 5.5 Not supported Not supported
(WebKit bug 76173)

Mobile browsers

Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support Not supported
(WebKit bug 76173)
12.0 (12.0)-moz 6.0 Not supported Not supported
(WebKit bug 76173)

Relative articles