O'Reilly logo

CSS Pocket Reference, 4th Edition by Eric A. Meyer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

letter-spacing

Values:

[ normal | <length> | <percentage> ]{1,3}

Initial value:

normal

Applies to:

All elements

Inherited:

Yes

Percentages:

Refer to the width of the Unicode space glyph (U+0020) of the element’s font face

Computed value:

For length values, the absolute length; otherwise, normal

Description:

Defines the amount of whitespace to be inserted between the character boxes of text. Because character glyphs are typically narrower than their character boxes, length values create a modifier to the usual spacing between letters. Thus, normal is (most likely) synonymous with 0. Negative length and percentage values are permitted and will cause letters to bunch closer together.

The three possible values correspond to the minimum, maximum, and optimal spacing between letters. If two values are listed, the first corresponds to the minimum and optimal spacing and the second to the maximum spacing. If a single value is listed, it is used for all three. If the text is justified, the user agent may exceed the maximum spacing if necessary, but it is never supposed to go below the minimum spacing. For nonjustified text, the optimal spacing is always used.

Examples:

p.spacious {letter-spacing: 6px;}
em {letter-spacing: 0.2em;}
p.cramped {letter-spacing: −0.5em;}

Note:

In CSS2.1, letter-spacing only accepts a single value: a length or normal.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required