Font Variant and Small Caps
What you'll learn: How to access alternate versions of letters in a font, especially small capitals, using the font-variant property.
What Is Font Variant?
Most fonts contain more than just the standard uppercase and lowercase letters you see. They often include alternate versions called glyphs—think of them as different "flavors" of the same letter. The font-variant property lets you access these alternate styles without changing the actual text content.
The most commonly used variant is small-caps, which displays lowercase letters as smaller versions of capital letters. It's like having uppercase letters, but sized down to blend better with regular text.
Using Small Caps
The font-variant property with the value small-caps transforms lowercase letters into miniature capitals:
.fancy-heading {
font-variant: small-caps;
}
When applied to text like "Hello World", it appears as "HELLO WORLD" but the originally lowercase letters are rendered slightly smaller than the true capitals.
Other Values
normal— The default, no variant stylingall-small-caps— Converts both uppercase and lowercase to small capitals
Real-World Use
Small caps are traditionally used for acronyms within body text, headings with a classical feel, or to emphasize certain words without the harsh impact of full capitals. They add typographic sophistication while maintaining readability.
.acronym {
font-variant: small-caps;
letter-spacing: 0.05em; /* slight spacing enhances the effect */
}
Key Takeaway: The font-variant property accesses alternate letter styles in fonts, with small-caps being the most practical variant for creating elegant, scaled-down capital letters from lowercase text.