The Letter-Spacing Property


The letter-spacing property lets you adjust the amount of spacing that occurs between letters. Similarly to word spacing, each font has a normal letter spacing the amount of space between letters that should be used in the "ideal" situation (as determined by the font's designer). Although browsers try to use this value, you may sometimes want to achieve certain effects with your text by expanding or shrinking the letter spacing.

Name:

letter-spacing

Value:

normal | <length>

Initial:

normal

Applies to:

all elements

Inherited:

yes

Percentages:

N/A


This property has two values:

  • normal Letter-spacing is left up to the browser. This is the default.

  • Length Either absolute or relative.

letter-spacing is an inherited property. The actual value is passed on. That is, the amount of letter spacing is computed once for the parent element and the result is inherited by all of its children. The value is not computed again for its child elements even if they have a different font size. For example, if the current font size of the parent element is 10pt and the letter spacing is set to 0.5em, its child elements will inherit a letter spacing of 5pt regardless of their font size.

The value can be negative, but browsers may have limitations on how far negative the value can be. Some browsers act as if the resulting space is 0; others may actually overlap the letters.

Here are examples of using the letter-spacing property:

 BLOCKQUOTE { letter-spacing: 0.04in } P { letter-spacing: 0.1em } 

In the first case, the space between letters will be increased by 0.04in. and in the second case, the space is increased by 0.1em.



Cascading Style Sheets(c) Designing for the Web
Cascading Style Sheets: Designing for the Web (3rd Edition)
ISBN: 0321193121
EAN: 2147483647
Year: 2003
Pages: 215

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net