You are here: Reference > CSS > properties > text-align-last

text-align-last property

Browser support:
Specifies the alignment type of the last or only line of text in the element's contents.
If you want to align text horizontally within an element, use the text-align property.
JavaScript page for this property: textAlignLast. You can find other example(s) there.

Possible values:

 One of the following values: 
auto
Default. The text content of the element is aligned like the other lines in the object.
center
The text content of the element is centered.
justify
The text content of the element is justified.
left
Aligns the text content of the element to the left.
right
Aligns the text content of the element to the right.
Default: auto.

Example HTML code 1:

This example illustrates the use of the text-align-last property:
<head>
    <style>
        .lastLeft {
            text-justify: distribute;
            text-align: justify;
            text-align-last: left;
        }
        .lastJustify {
            text-justify: distribute;
            text-align: justify;
            text-align-last: justify;
        }
    </style>
</head>
<body>
    <div class="lastLeft">
        The text of the first line is justified alonglonglonglonglonglonglonglonglongword.
        Next line is justified, too alonglonglonglongword.
        The last line is aligned to left.
    </div>
    <br />
    <div class="lastJustify">
        The text of the first line is justified alonglonglonglonglonglonglonglonglongword.
        Next line is justified, too alonglonglonglongword.
        The last line is justified, too.
    </div>
</body>
Did you find this example helpful? yes no

Supported by tags:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content