word-spacing

Set space between words.

Syntax

word-spacing: <word-spacing-value>;

The CSS units for word-spacing-value can be:

  • px
  • em

Example 2

Set the space between words in p tag to 0.5em:

p {
word-spacing: 0.5em;
}

For word spacing, using em values are recommended because the spacing can be set based on the size of the font.

Edit this page on GitHub

Contributors

Interested in helping build Docs? Read the Contribution Guide or share your feedback.

Learn CSS on Codecademy

Edit this page on GitHub

Contributors