XML technologies / CSS / Advanced websites with CSS / CSS property reference / text-justify

(Excerpt from “CSS − Advanced websites with Cascading Stylesheets” by Rachel Andrew & Dan Shafer)

The property text-justify, which is not part of the CSS specification, describes word spacing in a block element whose property text-align is set to justify. This property is intended for East Asian and Arabic languages. In these languages, changing word spacing, which is normally adjusted automatically for justified text, changes the meaning; CSS can therefore control it.

Inherited: yes

See also: text-align, text-kashida-space

Values

The property text-justify accepts the following constants:

  • auto: Word spacing is calculated automatically by the browser.

  • distribute: Word and character spacing is increased.

  • distribute-all-lines: Like distribute, also affecting the last line.

  • inter-cluster: Like distribute, without spaces between Southeast Asian character groups.

  • inter-ideograph: Like distribute, but without spaces between Latin letters.

  • inter-word: Increases only word spacing in languages using Latin script.

  • kashida: Increases spacing by extending strokes in Arabic scripts.

  • newspaper: Like distribute, giving additional word spacing priority over additional character spacing.

Default value: auto

Compatibility

CSS version: is not part of the CSS specification

Works only in Internet Explorer for Windows 5 and later (kashida only from version 5.5).

Corresponding functionality is planned for CSS3. However, the final property and value names will probably be different. Current information is available on the CSS Working Group website.

Example

The following style rule sets justified text in elements div of the class spaltentext to use the method newspaper:

div.spaltentext {
 text-align: justify;
 text-justify: newspaper;
}

  

 

 

 

back to top