Skip to content

Help us create more tutorials! Make a donation using the Donate button or become a member using the button below to hide this banner and track your progress.

Word spacing – CSS

Demo

Summary

To change the space between the words in an element’s text using CSS, use the word-spacing property:

selector {
  word-spacing: 5px;
}

Details

The word-spacing property takes a length value (like 1px or 1em). A positive value increases the space between words. A negative value decreases the space between words.

Exercises

First, recreate the CSS code from the Demo section in your CSS file. Then try changing the value for the property. Try using positive and negative values.

Reference

word-spacing – MDN

Back to: CSS Course > CSS Properties