Tracking — CSS letter-spacing and Where to Use It

Tweet

The letter-spacing property is an oft forgotten CSS option which allows us to change the tracking between letters. Altering the default spacing is seldom needed as text fonts are designed and optimised for legibility and readability exactly for setting larger blocks of text. However, the granular control of this horizontal spacing between letters can be useful in particular circumstances.

The letter-spacing property

The letter-spacing CSS property has been available since CSS1 and enjoys thankfully an almost perfect support from all the main browsers. To employ the property we simply call it and give it a length value:

h1 { letter-spacing: −1px; }

This length value is inserted between characters in addition to the default spacing (called the kerning). Quick note: while negative values are permitted percentages aren’t (for good reason). If you want to ensure your tracking remains relative to the font size (in case it is decreased or increased) set your values in ems.

The property also accepts the descriptive values “normal” and “inherit”, but the latter IE has some problems with.

Tracking also interacts with text justification, which is computed by the user agent (e.g browser) and font rendering engine. When text is justified (e.g. text-align: justify;) the browser will not alter the tracking unless letter-spacing: normal; is set. Remember however that “normal” and a value of “0” is not equivalent in this regard, so if you want to reset inherited letter-spacing and ensure it behaves accordingly be sure to set it back to “normal”.

There is another CSS property similar to letter-spacing provides control to word-spacing. Use case: just about never.

Use Cases for letter-spacing

Increasing Legibility

First and foremost letter-spacing allows us to insert additional space between text, which can aid in providing better legibility. The two prime examples for this are setting acronyms and strings of lining numbers or figures.

Spacing Acronyms

Acronyms being chiefly a string of uppercase characters are harder to discern than their lowercase equivalents due to the uniformity in height and the baseline the uppercase letters sit on (see my previous post, Top 10 Dos and Don’ts of Web Typography: #6).

A common technique to avoid causing acronyms in a block of text to spring out and act as eyesore is to set them in small-capitals (font-variant: small-caps;). By doing so the height of the now “small” capitals aligns to the x-height as sits nested better in the text. However as now smaller, the small-capitals can become somewhat illegible sitting as close as they are to one another by default.

Here we can call upon tracking by adding a few additional units of spacing between the glyphs. For example:

acronym, .caps, abbr {
    text-transform: lowercase;
    font-variant: small-caps;
    font-style: normal;
    letter-spacing: 1px;
    }

A paragraph with full-cap acronyms with default tracking.

Same paragraph as above with acronyms set in small-capitals and with slightly enlarged tracking.

Spacing Lining Figures

A second example is additional spacing given occasionally to lining figures, that is figures (i.e. numbers) which are uniform in height and don’t extend beyond the x-height or drop below the baseline like text or “old-style” figures.

The same principles from setting acronyms apply. Although not chiefly done for figures that reside in body copy (because ideally you’d use text figures) lining figures are commonly used in tabular work: e.g. financial reports. See below for an example where lining figures are intermixed with full-caps in the form of ID numbers:

An example of ID numbers composed of lining figures and full-caps tracked loosely.

For Aesthetics

Tracking can be employed for aesthetics too. One particular popular trend is to negatively space Helvetica (or Arial):

An example of both normal and negative tracking applied to Helvetica Bold

Note: be very careful when applying negative spacing as not to make the text illegible and harder to read. The above styling would become difficult to read if set at a smaller size so reserve negative spacing for special occasions and only at ample sizes.

Closing

Tracking is just another tool that allows designers and typographers to fine-tune the horizontal spacing of text. Its application should by and large be to increase legibility. Be wary in applying tracking for purely stylistic reasons: don’t alter integral spacings without cause.

Free book: Jump Start HTML5 Basics

Grab a free copy of one our latest ebooks! Packed with hints and tips on HTML5's most powerful new features.

  • http://www.thejazzband.co.za Theo Bunge

    Thanks Simon. Designing text is an art – great article.

  • Amber

    You’re misuing the phrase “tracking”
    tracking is the spacing between lines of text, ie:

    “I want to increase my tracking,

    so I put extra space between these lines.”

    Whereas “letter-spacing” as you call it is actually called Kerning.

  • http://www.samsungmobiles.com.pk Josh Pfohl

    I was wondering to find this tracking property in css, as i am designer and learning css now a days. This really helped me out. Keep Writting wonderful articles. Thanks buddy..