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;
}
Copyright © 2006 of the German translation, dpunkt.verlag GmbH
You may print the online version for your private use.
Otherwise, this chapter from “CSS − Anspruchsvolle Websites mit Cascading Stylesheets” is subject to the same conditions as the bound edition: the work, including all its parts, is protected by copyright. All rights reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
dpunkt.verlag GmbH, Ringstraße 19, 69115 Heidelberg