B.128. word-spacing

This property lets you either increase or decrease the amount of spacing between words in an element.

Inherited: Yes

See also: Section B.56letter-spacing

B.128.1. Value

Any CSS length, or normal. Percentages are not allowed.

Positive lengths increase word spacing by the specified amount, while negative lengths decrease it. In most cases, it is preferable to specify the spacing in ems (e.g. 0.5em), as this will preserve the relative spacing of words, even if you change the font size (one em is equal to the height of the current font).

Initial value: normal

B.128.2. Compatibility

CSS Version: 1

This property is supported by Mozilla browsers (including Netscape 6 or later), Internet Explorer for Windows version 6 or later, Internet Explorer for Macintosh version 4.01 or later, and Opera browsers.

B.128.3. Examples

This style rule sets all elements of class spacy to have extra spacing one half the height of the font between each word:

.spacy {
  word-spacing: 0.5em;
}

This style rule sets all elements of class crowded to display words one half the font size closer together than usual:

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

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset