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

The rusty swing set creaked a lonely lullaby in the twilight, shadows lengthening like grasping fingers across the dew-kissed grass. A lone dandelion seed, adrift on the breeze, whispered secrets of faraway fields, of dandelion suns and galaxies spun from fluff. Somewhere, beyond the veil of dusk, a coyote laughed, echoing through the stillness like a forgotten memory.

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
Edge Chrome Firefox Opera Safari
12113.51
Tablets / Mobile
Chrome Firefox Opera Safari Samsung Webview
18414114.4

Last updated by CSSPortal on: 31st December 2023