CSS word-spacing Property
Description
The word-spacing
property sets the spacing between words. If the text is set to align through text-align with the value justify (justification in width), then the spacing between words will be set forcefully, but not less than the value specified through word-spacing.
- Initial value
- normal
- Applies to
- All elements
- Inherited
- Yes
- Computed value
- An absolute length
- Animatable
- No
- JavaScript syntax
- object.style.wordSpacing
Interactive Demo
Syntax
word-spacing: [ normal | <length> | <percentage>]
Values
- normalNo additional spacing is applied.
- <length>Specifies extra spacing in addition to the intrinsic inter-word spacing defined by the font. Values may be negative, but there may be implementation-dependent limits.
- <percentage>Specifies the additional spacing as a percentage of the affected character's advance measure.
- inherit
Example
<p class="test">Eat more of these soft French rolls and drink some tea. Eat these soft French rolls and drink some tea. Eat these soft French rolls and drink some tea. Eat these soft French rolls and drink some tea.</p>
<p class="test2">Eat more of these soft French rolls and drink some tea. Eat these soft French rolls and drink some tea. Eat these soft French rolls and drink some tea. Eat these soft French rolls and drink some tea.</p>
<p class="test3">Eat these soft French rolls and drink some tea. Eat these soft French rolls and drink some tea. Eat these soft French rolls and drink some tea. Eat these soft French rolls and drink some tea.</p>
.test {
word-spacing: normal;
}
.test2 {
word-spacing: 15px;
}
.test3 {
word-spacing: -5px;
}
Browser Support
The following table will show you the current browser support for the CSS word-spacing
property.
Desktop | |||||
12 | 1 | 1 | 3.5 | 1 |
Tablets / Mobile | |||||
18 | 4 | 14 | 1 | 1 | 4.4 |
Last updated by CSSPortal on: 31st December 2023