Widely availableSupported across all major browsers. Safe to use in production.

Overview

The text-align-last CSS property sets the alignment of the last line of text before a forced line break.

Browser support

Feature Desktop Mobile
Chrome
Edge
Firefox
Safari
Chrome Android
Safari iOS
47
12
49
16
47
16
auto
47
12
12
16
47
16
1+Supported (version) Not supported Has note Sub-feature descriptions sourced from MDN Web Docs (CC BY-SA 2.5)
Notes 2 item(s)
Removed
  • This feature was removed in a later browser version (53)
Compatibility
  • Available with a vendor prefix: -moz- (12)

Syntax

CSS
.justified {
  text-align: justify;
  text-align-last: center;
}

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

Live demo

final row center

text-align-last final row center demo.

PreviewFullscreen

final row right aligned

text-align-last final row right aligned demo.

PreviewFullscreen

final row justify

text-align-last final row justify demo.

PreviewFullscreen

Use cases

  • Using text-align-last

    The text-align-last CSS property sets the alignment of the last line of text before a forced line break.

Cautions

  • May not be supported in older browsers.

Accessibility

  • Make sure visual changes are conveyed appropriately to assistive technology.

Powered by web-features