Name
letter-spacing — NN n/a IE 4 CSS 1
Synopsis
Inherited: Yes
Defines the spacing between characters within an element. Browsers
normally define the character spacing based on font definitions and
operating system font rendering. To override those settings, assign a
length value to the letter-spacing
attribute. A
negative value tightens up the spacing, but be sure to test the
effect on the selected font for readability on different operating
systems.
CSS Syntax
letter-spacing: normal | length
| auto
Value
See the discussion at the beginning of this chapter about length
values. The best results use units that are based on the rendered
font size (em
and ex
). A
setting of normal
is how the browser sets the
letters without any intervention. A setting of
auto
(CSS2) is intended for use with single-line
elements (such as H1
and the like) to space the
letters such that the element content appears on a single line given
the current width of the containing box.
Initial Value
normal
Example
.tight {letter-spacing: -0.03em} BLOCKQUOTE {letter-spacing: 1.1em}
Applies To
All elements.
Object Model Reference
- IE
[window.]document.all.
elementID
.style.letterSpacing
Get Dynamic HTML: The Definitive Reference now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.