Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Style wordSpacing property

Style wordSpacing property

Style Object Reference The Style object


Definition and Usage

The wordSpacing property sets or returns the spacing between words in text.

Syntax

Set the wordSpacing property:

Object.style.wordSpacing="normal|

length

|inherit"

Return the wordSpacing property:

Object.style.wordSpacing

Value Description
normal Default. Defines the standard spacing between words.
length Defines the spacing between words using units such as px and cm. Negative values are allowed.
inherit The value of the wordSpacing property is inherited from the parent element.

Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the wordSpacing property.

**Note:** IE7 and earlier versions do not support the "inherit" value. IE8 supports "inherit" only if a !DOCTYPE is specified. IE9 supports "inherit".


Example

Example

Change the spacing between words:

Runoob Tutorial(runoob.com)

This is some text.


Try it »


Style Object Reference The Style object