O'Reilly logo

CSS Pocket Reference, 4th Edition by Eric A. Meyer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

word-spacing

Values:

[ normal | <length> | <percentage> ]{1,3}

Initial value:

normal

Applies to:

All elements

Inherited:

Yes

Percentages:

Refer to the width of the Unicode space glyph (U+0020) of the element’s font face

Computed value:

For length values, the absolute length; otherwise, normal

Description:

Defines the amount of whitespace to be inserted between words. Note that the specification does not define what constitutes a “word.” In typical practice, user agents will apply this to the collapsed whitespace between strings of nonwhitespace characters. Negative length values are permitted and will cause words to bunch closer together.

Examples:

p.spacious {letter-spacing: 6px;}
em {letter-spacing: 0.2em;}
p.cramped {letter-spacing: −0.5em;}

Note:

In CSS2.1, word-spacing only accepts a single value: either a <length> or normal.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required