You are here: Reference > CSS > properties > text-justify

text-justify property

Browser support:
Specifies how justified text should be aligned and spaced.
This property has effect only if the value of the text-align property is set to 'justify'.
JavaScript page for this property: textJustify. You can find other example(s) there.

Possible values:

 One of the following values: 
auto
The browser determines the appropriate justification algorithm.
distribute
Like the newspaper value, except that in East Asian languages (such as Thai) the last line is not justified.
distribute-all-lines
Like the newspaper value, except that the last line is also justified.
inter-cluster
Only content that does not contain any inter-word spacing (such as Asian languages) is justified.
inter-ideograph
Justifies content with ideographic text.
inter-word
Increases the spacing between words.
kashida
Justifies content by elongating characters.
newspaper
Spacing between letters and words are increased or decreased.
Default: auto.

Example HTML code 1:

This example illustrates the use of the text-justify property:
<head>
    <style>
        .lastLeft {
            text-justify: distribute;
            text-align: justify;
        }
        .lastJustify {
            text-justify: distribute-all-lines;
            text-align: 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