CSS Property text-justify








text-justify specifies how to justify the text.

Summary

Initial value
auto
Inherited
yes
CSS Version
CSS3
JavaScript syntax
object.style.textJustify="inter-word"
Animatable
no

CSS Syntax

text-justify: auto|inter-word|inter-ideograph|inter-cluster|distribute|kashida|trim|initial|inherit;

Property Values

The text-justify Property Values are listed as follows.

  • auto - The browser selects the justification.
  • none - No Justification.
  • inter-word - Spacing is distributed between words. This is suited to languages that use word separators, such as English.
  • inter-ideograph - Spacing is distributed between words and at inter-graphemic boundaries. suited for Japanese and Korean.
  • inter-cluster - Spacing is distributed between words and at grapheme cluster boundaries. suited for Thai.
  • distribute - Spacing is distributed between words and at grapheme cluster boundaries in all scripts except those that use connected or cursive styles.
  • kashida - Justification is applied by elongating characters (applies only to cursive scripts).




Browser compatibility

text-justify No 5.5 No No No

Example

<!DOCTYPE html>
<html>
<head>
<style>
div {<!--from  ww  w .j a v a2 s  . co m-->
    text-align: justify;
    text-justify: inter-word;
}
</style>
</head>
<body>

<div>this is a test. this is a test. this is a test. this is a test. this is a test. 
this is a test. this is a test. this is a test. this is a test. this is a test. 
this is a test. this is a test. this is a test. this is a test. this is a test. 
this is a test. this is a test. this is a test. this is a test. this is a test. 
this is a test. this is a test. this is a test. this is a test. this is a test. 
this is a test. this is a test. this is a test. this is a test. this is a test. 
this is a test. this is a test. this is a test. this is a test. this is a test. 
this is a test. this is a test. this is a test. this is a test. this is a test. 
this is a test. this is a test. this is a test. this is a test. this is a test. 
this is a test. this is a test. this is a test. this is a test. this is a test. 
this is a test. this is a test. this is a test. this is a test. this is a test. 
this is a test. this is a test. this is a test. this is a test. this is a test. 
this is a test. this is a test. this is a test. this is a test. this is a test. 
this is a test. this is a test. this is a test. this is a test. this is a test. 
this is a test. this is a test. this is a test. this is a test. this is a test. 
this is a test. this is a test. this is a test. this is a test. this is a test. 
this is a test. this is a test. this is a test. this is a test. this is a test. 
this is a test. this is a test. this is a test. this is a test. this is a test. 
this is a test. this is a test. this is a test. this is a test. this is a test. 
this is a test. this is a test. this is a test. this is a test. this is a test. 
this is a test. this is a test. this is a test. this is a test. this is a test. 
this is a test. this is a test. this is a test. this is a test. this is a test. 
this is a test. this is a test. this is a test. this is a test. this is a test. 
this is a test. this is a test. this is a test. this is a test. this is a test. 
this is a test. this is a test. this is a test. this is a test. this is a test. 

</div>


</body>
</html>

Click to view the demo