CSS Attributes Index Text Attributes
Sets or retrieves the amount of additional space between letters in the object.
CSS |
{ letter-spacing: 'normal' | length } |
Script |
object.style.letterSpacing = sSpacing ] |
normal |
Default spacing. |
length |
Floating-point number and a valid CSS length unit: either an absolute units designator ( cm, mm, in, pt, pc, or px ) or a relative units designator ( em or ex ). |
The property is read/write with a default value of normal; the CSS attribute is inherited.
The attribute will add the appropriate letter spacing after each character. For the end of a word not to be affected by the spacing, place the last character outside the closing tag. Letter spacing can be influenced by justification. The length value indicates an addition to the default space between characters. Negative values are permitted.
The following example demonstrates the effects of applying the different values possible for the CSS letter-spacing attribute.
Show me
The sample below uses inline event handlers to dynamically set an object’s letterSpacing property in response to mouse events.
p onmouseover="this.style.letterSpacing='1mm'"
onmouseout="this.style.letterSpacing=''">
...
</p>
Show me
line-height