text-align-last - HTML CSS CSS Property

HTML CSS examples for CSS Property:text-align-last

Description

The text-align-last CSS property sets how the last line of a block is aligned.

The following table summarizes the text-align-last Property.

Item Value
Default value: auto
Applies to:Block containers
Inherited: Yes
Animatable: No.

Syntax

The syntax of the property is as follows:


text-align-last:     auto | start | end | left | right | center | justify | initial | inherit

Property Values

The following table describes the values of this property.

Value Description
autoaligned per the value of the text-align property, unless the text-align is set to justify. This is default value.
start Same as left if direction is left-to-right and right if direction is right-to-left.
end Same as right if direction is left-to-right and left if direction is right-to-left.
leftaligned to the left.
right aligned to the right.
center center-aligned.
justify justified like the other lines in the block.
initial Sets this property to its default value.
inherit take the value of its parent element text-align-last property.

The example below shows the text-align-last property.

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html lang="en">
 <head>
  <title>Example of CSS3 text-align-last Property</title>
  <style type="text/css">
  p {<!--from  www. j ava  2  s  .com-->
    -moz-text-align-last: right; /* Firefox */
    text-align-last: right; /* Standard syntax */
  }
</style>
 </head>
 <body>
  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam eu sem tempor, varius quam at, luctus dui. Mauris magna metus, dapibus nec turpis vel, semper malesuada ante. Vestibulum id metus ac nisl bibendum scelerisque non non purus. Suspendisse varius nibh non aliquet sagittis. In tincidunt orci sit amet elementum vestibulum. Vivamus fermentum in arcu in aliquam. Quisque aliquam porta odio in fringilla. Vivamus nisl leo, blandit at bibendum eu, tristique eget risus. Integer aliquet quam ut elit suscipit, id interdum neque porttitor. Integer faucibus ligula.</p>
 </body>
</html>

Related Tutorials