English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
word-The spacing CSS attribute sets the word spacing of the text content, increasing or decreasing the spacing between words.
The following table provides usage instructions and version history of this attribute, as well as the syntax of using this attribute in JavaScript scripts.
Default value: | normal |
---|---|
Applies to: | All elements. It also applies to:: first-line. |
Inheritance: | Yes |
Can be animated: | Yes.Please refer to Animation properties. |
Version: | CSS 1,2,3 |
JavaScript syntax: | object.style.wordSpacing="20px" |
The syntax of this attribute is as follows:
word-spacing: length | normal | initial | inherit
The following examples demonstrate how to use word-spacing attribute.
p { word-spacing: 50px; }Test and see‹/›
The following table describes the value of this attribute.
Value | Description |
---|---|
length | Specify the additional spacing between words, with length values such as px, pt, cm, em, etc. Negative length values are allowed. |
normal | Specify the spacing between words based on the current font and/or the normal word spacing defined by the browser. This is the default value. |
initial | Set this attribute to its default value. |
inherit | If specified, the associated element adopts the word spacing of its parent element.-The value of the spacing attribute. |
word-Browser compatibility of the spacing attribute, the numbers in the table below represent the minimum version number of browsers that support this attribute; all mainstream browsers support this attribute.
|
Please refer to the following tutorials:HTML text formatting.
Related attributes:letter-spacing,white-space.