CSS letter-spacing
property is used to set horizontal spacing between the characters of a text.
The letter-spacing
property can accept a positive, negative, or zero value and can be specified in any valid CSS length format. See the example below:
Example:
.p1{ letter-spacing: 7px; } .p2{ letter-spacing: 0px; } .p3{ letter-spacing: -1px; }
CSS Syntax
The letter-spacing
property has the following syntax:
letter-spacing: normal|length|initial|inherit;
Property Values
The letter-spacing
property accepts the following values:
normal | No extra space between the characters. This is the default value. |
length | Sets extra spacing between the characters in any valid CSS length formats like ‘px’, ’em’, ‘rem’, ‘cm’, etc. |
initial | Sets the letter-spacing property to its default value(normal). |
inherit | Inherits the letter-spacing property from the parent element. |
General Info
Default Value | normal |
Inherited | Yes |
JavaScript Usage | element.style.letterSpacing = “7px” |