CSS Reference ยท Typography
The font-variant-caps property
Reference for the CSS font-variant-caps property: small-caps, all-small-caps, petite-caps, unicase and titling-caps, how synthesis works, with live examples.
The font-variant-caps property selects capital-letter alternatives from the font: small capitals, petite capitals, unicase and titling capitals. Small caps are capital-shaped letters about the height of lowercase letters, often used for abbreviations, names and short labels.
With a font that has true small caps, the glyphs are redrawn so their stroke weight matches the surrounding text. Without them, browsers scale down ordinary capitals, which works but looks lighter.
.abbr { font-variant-caps: all-small-caps; }
Try it
small-caps turns lowercase letters into small capitals and leaves real capitals alone; all-small-caps shrinks both. Notice that "NASA" keeps full-size letters in the first case. The unicase and titling-caps rows look unchanged where the font has no such glyphs.
Syntax
font-variant-caps: normal | small-caps | all-small-caps | petite-caps
| all-petite-caps | unicase | titling-caps;
| Initial value | normal |
| Applies to | All elements and text |
| Inherited | Yes |
| Animatable | No |
| Computed value | As specified |
Values
| Value | Description |
|---|---|
normal |
No caps variants. |
small-caps |
Lowercase letters become small capitals. |
all-small-caps |
Lowercase and uppercase letters both become small capitals. |
petite-caps |
Lowercase letters become petite capitals, smaller than small caps (needs font support). |
all-petite-caps |
Both cases become petite capitals (needs font support). |
unicase |
Mixes small capitals and capitals in one case (needs font support). |
titling-caps |
Capitals designed for large headings, less heavy than normal capitals (needs font support). |
Usage notes
- Synthesis. Only
small-capsandall-small-capsare synthesized when the font lacks them, and you can turn that off withfont-synthesis: none(orfont-synthesis-small-caps: none). The other values do nothing without font support. - Not the same as uppercase.
text-transform: uppercasechanges the text into capitals at full size; small caps keep the text and change only the glyphs shown. - Source text matters.
small-capsneeds lowercase letters in the HTML to shrink. Text already typed in capitals stays full size, which is whyall-small-capsexists. - Letter spacing. Small caps look tight; add a little
letter-spacing, around0.05emto0.08em. - Shorthand.
font-variant: small-capssets this property and resets sibling variants.
Browser support
The common values (small-caps, all-small-caps) work in all current browsers; the other values depend on the font as well as the browser.