The word-spacing property

The word-spacing property sets a spacing between words. The property value is any size units, except percentages. A negative value is acceptable. The normal value allows the browser to calculate the spacing between words itself (default value).

If text alignment is set to text-align in the justify value, then the spacing between words will be set automatically, but not less than the value specified via word-spacing.

Syntax

cssselector {
  word-spacing: value;
}

Example

Let's set a spacing between words to 30px:

html<p>
  Lorem ipsum dolor sit amet, consectetur adipiscing.
</p>
cssp {
  word-spacing: 30px;
  text-align: left;
}

Результат:

Example

Let's set word-spacing to a negative value - a spacing between words will almost disappear:

html<p>
  Lorem ipsum dolor sit amet, consectetur adipiscing.
</p>
cssp {
  word-spacing: -7px;
}

Результат:

Example

Setting this property to zero does not cause words overlap:

html<p>
  Lorem ipsum dolor sit amet, consectetur adipiscing.
</p>
cssp {
  word-spacing: 0;
}

Результат:

Example

Let's set word-spacing to normal (this is the default value):

html<p>
  Lorem ipsum dolor sit amet, consectetur adipiscing.
</p>
cssp {
  word-spacing: normal;
}

Результат: