English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
letter-The spacing CSS attribute sets the additional spacing between letters of the element text.
The following table provides usage instructions and version history of this attribute, as well as the syntax of its use in JavaScript scripts.
Default value: | normal |
---|---|
Applies to: | all elements. It also applies to:: first-letterand:: first-line. |
Inheritance: | Yes |
Can be animated: | Yes.Please refer to Animation attribute. |
Version: | CSS 1,2,3 |
JavaScript syntax: | object.style.letterSpacing="5px" |
The syntax of this attribute is as follows:
letter-spacing: length | normal | initial | inherit
The following examples demonstrate how to use letter-spacing attribute.
h1 { letter-spacing: -3px; } p { letter-spacing: 15px; }Test and see‹/›
Note:for letter-The spacing attribute, the normal value is not equal to the length value 0. If the value is the normal value, the space can be adjusted by the browser to align the text; if the value is 0, it cannot.
The following table describes the value of this attribute.
Value | Description |
---|---|
normal | Spacing is the normal spacing of the current font. This space can be adjusted by the browser to align text. This is the default value. |
length | The length value specifies the additional spacing inserted between characters other than the default character spacing. Browsers may not be able to adjust this space to align text. |
initial | Set this attribute to its default value. |
inherit | If specified, the associated element adopts the letter spacing of its parent element letter-The value of the spacing attribute. |
etter-The compatibility of the spacing attribute across browsers, the numbers in the table below represent the minimum version number of the browser that supports this attribute; all mainstream browsers support this attribute.
|
Please refer to the following tutorials:CSS Text.
Related attributes:white-space,word-spacing.