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
selector {
word-spacing: value;
}
Example
Let's set a spacing between
words to 30px
:
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing.
</p>
p {
word-spacing: 30px;
text-align: left;
}
:
Example
Let's set word-spacing
to a negative
value - a spacing between words will almost
disappear:
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing.
</p>
p {
word-spacing: -7px;
}
:
Example
Setting this property to zero does not cause words overlap:
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing.
</p>
p {
word-spacing: 0;
}
:
Example
Let's set word-spacing
to normal
(this is the default value):
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing.
</p>
p {
word-spacing: normal;
}
: