text-align-last

Jump to: navigation, search

text-align-last


W3C Working Draft

Summary

The text-align-last CSS property describes how the last line of a block element or a line before line break is aligned in its parent block element.

Overview table

Initial value auto
Applies to block containers
Inherited Yes
Media visual
Computed value specified value
Animatable No
CSS Object Model Property textAlignLast

Syntax

  • text-align-last: left
  • text-align-last: right
  • text-align-last: center
  • text-align-last: auto
  • text-align-last: justify
  • text-align-last: start
  • text-align-last: end


Values

auto
Default. Text is aligned like the other lines in the object, using the value of the text-align property.
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
Text is aligned to the left.
right
Text is aligned to the right.
center
The text is centered within the line box.
justify
Text is justified if ‘text-justify’ is ‘distribute’, and the same as start value if otherwise.


Examples

View live exampleThe following example shows an embedded style rule that justifies all the lines in the document's p elements. This is sometimes found in East Asian typography.

HTML

<p class="normal">Simple example with "auto" value of text-align-last property. This paragraph needs to be really long in order to show how to work with text-align-last property. It only works because we set a width for this paragraph though.</p>

<p class="justified">Simple example with "justify" value of text-align-last property. In this case, the last line is also justified. This paragraph needs to be really long in order to show how to work with text-align-last property.</p>

CSS

.normal { 
	width: 300px;
	text-align: justify;
	text-align-last: auto;
}

.justified { 
	width: 300px;
	text-align: justify;
	text-align-last: justify;
}



Related specifications

Specification Status Related Changes
CSS Text Module Level 3 W3C Working Draft

Compatibility

Desktop

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic Support Unsupported
12.0
5.5
Unsupported
Unsupported

Mobile

Feature Android BlackBerry Chrome for mobile Firefox Mobile (Gecko) IE Mobile Opera Mobile Opera Mini Safari Mobile
Basic Support Unsupported
Unsupported
Unsupported
12.0 (-moz) -moz
?
Unsupported
Unsupported
Unsupported

See also

Related articles

Text

























  • text-align-last


























… further results

Other articles

Attribution

This article contains content originally from external sources.

Portions of this content come from the Microsoft Developer Network: [Windows Internet Explorer API reference Article]