🔡 CSS letter-spacing
: Adjusting Space Between Characters
Good typography is more than just choosing the right font. The spacing between characters — also known as tracking — can impact readability, visual balance, and overall design aesthetics. The CSS letter-spacing
property allows you to fine-tune this spacing, making your text appear tighter or more open.
🧾 What is letter-spacing
?
The letter-spacing
property in CSS is used to increase or decrease the horizontal space between characters in text. It applies spacing uniformly across all characters of an element’s text.
🧬 Syntax
selector {
letter-spacing: normal | <length> | inherit;
}
Value Types:
Value | Description |
---|---|
normal | Default spacing defined by the font |
<length> | Spacing value in units like px , em , rem , etc. |
inherit | Inherits the value from the parent element |
🎯 Example Usage
1. Increase spacing (more open text)
h1 {
letter-spacing: 2px;
}
2. Tighten text (condense character spacing)
.nav-link {
letter-spacing: -0.5px;
}
3. Responsive and scalable spacing
p {
letter-spacing: 0.05em;
}
Using em
ensures the spacing scales relative to the font size.
🧠 How It Works
- Positive values create more space between letters.
- Negative values pull letters closer together.
- Applies evenly to all characters in an element, including spaces.
- Doesn’t affect line breaks or word spacing — just the spacing between individual letters.
🛠️ Best Practices
- Use small values (like
0.1em
or1px
) — even slight changes can have a big visual impact. - Adjust spacing for headings, logos, buttons, or uppercase text to improve readability or visual appeal.
- Combine with
text-transform: uppercase
for a clean, modern look. - Use negative spacing sparingly — it can hurt legibility if overdone.
- Test across fonts — some fonts have naturally tighter or looser spacing.
✅ Browser Support
letter-spacing
is widely supported across all browsers:
- ✅ Chrome
- ✅ Firefox
- ✅ Safari
- ✅ Edge
- ✅ Internet Explorer 6+
🔚 Conclusion
The CSS letter-spacing
property is a powerful, fine-tuning tool for designers and developers. Whether you’re crafting elegant headers, accessible body text, or impactful branding, controlling character spacing helps you express style and improve readability.