The Word-Spacing Property


The word-spacing property enables you to adjust the amount of spacing between words. Each font has a normal word spacing the amount of space that is put between words that should be used in the "ideal" situation (ideal according to the font's designer). Browsers try to use this value. However, you may sometimes want to achieve certain effects with your text by expanding or shrinking the word spacing.

Name:

word-spacing

Value:

normal | <length>

Initial:

normal

Applies to:

all elements

Inherited:

yes

Percentages:

N/A


There are two values:

  • normal Word spacing is left up to the browser. This is the default.

  • Length Either an absolute or relative value.

Any length value is added to the normal word spacing; thus, 0 and normal mean the same thing.

word-spacing is an inherited property. The amount of word spacing is computed once for the parent element and the result is inherited by all of its children. The value is not computed again for its child elements even if they have a different font size. For example, if the current font size of the parent element is 10pt and the word spacing is set to lem, its child elements will inherit a word spacing of 10pt no matter their font size.

The value can be negative, provided the resulting amount of word spacing is not negative. What happens if the original word spacing minus the set value of word-spacing is less than 0 is undefined. Some browsers act as if the resulting space is 0; others may actually overlap the words.

Here are example rules of the use of the word-spacing property:

 H1 { word-spacing: 15mm } P { word-spacing: 0.4em } 

In the first case, the space between words will be increased by 15mm and in the second case, the space will increase by 0.4em.



Cascading Style Sheets(c) Designing for the Web
Cascading Style Sheets: Designing for the Web (3rd Edition)
ISBN: 0321193121
EAN: 2147483647
Year: 2003
Pages: 215

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net