CSS Reference ยท Typography
The letter-spacing property
Reference for the CSS letter-spacing property: widening or tightening the gap between characters, em vs px, uppercase text, accessibility and examples.
The letter-spacing property adds extra space between characters (often called tracking). A positive value spreads the letters apart, a negative value pulls them closer, and normal leaves the font's own spacing untouched. It is most useful for small uppercase labels, buttons and large display headings.
CSS
.label { text-transform: uppercase; letter-spacing: 0.08em; }
Try it
The em versions keep the same proportions at both sizes. The px versions look loose when small and tight when large.
Syntax
CSS
letter-spacing: normal | <length>;
- Initial value:
normal - Applies to: all elements; also
::first-letterand::first-line - Inherited: yes
- Animatable: yes, as a length
- Computed value: an absolute length (
normalcomputes to0)
Values
| Value | Description |
|---|---|
normal |
The default spacing from the font. Behaves like 0 for most purposes. |
<length> |
Extra space added after each character, such as 0.05em or 1px. Negative values are allowed. |
Usage notes
- Use
emfor proportional tracking. The spacing then scales when the font size changes. - Uppercase likes space. Capital letters were not designed to sit in long runs, so a small positive value (about 0.05em to 0.15em) improves them. Lowercase body text should usually stay at
normal. - Large headings often want negative tracking. Slightly tighter spacing, such as
-0.01emto-0.03em, can look better at big sizes. Keep it small. - Don't track cursive scripts. Writing systems such as Arabic connect letters, and extra spacing breaks the joins. Browsers may disable it in some cases, but avoid relying on that.
- Ligatures. When the value is not zero, browsers normally turn off optional ligatures, so "fi" may separate.
- Space is added after the last letter too. Centered text with positive tracking can look shifted left by half the value. Compensate with a small negative
margin-rightor padding if the offset matters. - Accessibility. Very tight or very wide spacing hurts readability. Wide tracking in long sentences makes them harder to scan.
Browser support
Supported in every browser.
Related
word-spacingโ spacing between wordsline-heightโ spacing between linestext-transformโ commonly paired for uppercase labels- Lesson: Styling Text
- Lesson: Fonts