Skip to: content, navigation

by Tommy Olsson and Paul O’Brien

word-spacing (CSS property)

Browser support full matrix
IE6+ FF1+ Saf1.3+ Op9.2+
Full Buggy Full Buggy
Spec
Inherited Initial Version
Yes normal CSS1, 2

Example

This style rule adds half an em square of spacing between words in paragraph elements:

p {
  word-spacing: 0.5em;
}

Try it yourself!View all demos

Description

The word-spacing property sets the extra spacing between words in the text content of an element.

Word spacing can be affected by text justification (see the text-align property).

When whitespace is preserved—see white-space—all space characters are affected by word spacing.

Value

A length value specifies extra space to be inserted between words in addition to the default inter-word space.

Negative length values are legal.

A value of normal means no extra space will appear between words.

Compatibility

IE5.5None
6.0Full
7.0Full
Firefox1.0Buggy
1.5Buggy
2.0Buggy
Safari1.3Full
2.0Full
3.0Full
Opera9.2Buggy
9.5Buggy

Internet Explorer for Windows versions up to and including 7 don’t support the value inherit.

In Firefox versions up to and including 2, and in Opera versions up to and including 9.5, the whitespace between inline child elements has a minimum width of zero.

User-contributed notes

There are no comments yet.

Add a note

To post a note on this topic, please log in with your SitePoint username and password. If you don't have an account yet, you can create a new account for free.

Related Products

The Principles of Beautiful Web Design

Best Seller!

You don’t need to go to Art School to design great looking web sites!

Book Cover: The Principles of Beautiful Web Design

Download the FREE sample chapters