word-spacing property
Specifies the amount of additional space between words in the object.
![]() ![]() |
Syntax
word-spacing: normal |
<length>
Property values
normal-
Default. Default spacing.
- length
-
Floating-point followed by an absolute units designator (
cm,mm,in,pt, orpc) or a relative units designator (em,ex, orpx). For more information about the supported length units, see CSS Values and Units Reference.
CSS information
| Applies To | All elements |
|---|---|
| Media | visual |
| Inherited | 1 |
| Initial Value |
Standards information
- CSS 2.1, Section 5.4.1
Remarks
The word-spacing property is available on Macintosh beginning with Microsoft Internet Explorer 4.01. It is available for other platforms beginning with Microsoft Internet Explorer 6.
This attribute adds the specified spacing after each word. Justification can influence word spacing.
The length value indicates an addition to the default space between words. Negative values are permitted.
In Internet Explorer 6, This property now applies to the currentStyle element.
Examples
The following example shows how to use the word-spacing attribute and the word-spacing property to increase the amount of space between words in a span.
<!DOCTYPE html>
<html>
<head>
<title>spacing</title>
<style>
.spacing {
word-spacing: 10px;
}
</style>
</head>
<body>
<select id="oSelSpace" onchange="fnChangeSpace()">
<option>10</option>
<option>15</option>
<option>20</option>
</select>
<span id="oSpan" class="spacing">The quick brown fox jumped over the lazy dog.
</span>
<script>
function fnChangeSpace() {
var oSpan = document.getElementById('oSpan');
oSpan.style.wordSpacing = oSelSpace.options[oSelSpace.selectedIndex].text + "px";
}
</script>
</body>
</html>
See also
- CSSStyleDeclaration
- currentStyle
- runtimeStyle
- style
- CSS Enhancements in Internet Explorer 6

