XML technologies / CSS / Advanced websites with CSS / CSS property reference / word-spacing

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

The property word-spacing describes the spacing between individual words in an HTML element.

Inherited: yes

See also: letter-spacing

Values

An absolute CSS measurement or the constant normal. Percentages are not allowed.

Positive values increase word spacing; negative values reduce it. In most cases, values in em (for example 0.5em) are recommended. This preserves the typeface’s relative spacing even when the font size changes (one em equals the font size).

Default value: normal

Compatibility

CSS version: 1

Works in Mozilla-based browsers (including Netscape 6 and later), Internet Explorer for Windows 6 and later, Internet Explorer for Macintosh 4.01 and later, and Opera.

Examples

The following rule adds word spacing equal to half the font size for all elements of the class luftig:

.luftig {
 word-spacing: 0.5em;
}

The following rule reduces word spacing by half the font size for all elements of the class gedrungen:

.gedrungen {
 word-spacing: -0.5em;
}

  

 

 

 

back to top