Educational guide to font-variant
Choosing variants for readable text and numbers
Combine small capitals, ligatures and numeric variants. Understand East Asian forms and typographic positioning without mistaking accepted syntax for font capabilities.
Mental model
font-variant requests alternative glyph forms. It does not change text characters or select a new family. The result depends on font features, language and active rules; some variants allow synthesis when dedicated outlines are missing.
- Express an intention
Request small capitals, tabular figures or a typographic position.
- Consult the font
Resolve the available features for those characters and their language.
- Lay out and read
Review outlines, metrics and the readability of the result.
Compose without accidental resets
The shorthand replaces the set of variants: omitted subproperties return to their initial values. Use longhands to change one family without clearing the others. Variants are inherited.
One inherited base, two ways to add ligatures
Inherits small-caps and tabular figures
Atlas of Typography · 0123456789
Shorthand · resets omitted variants
Atlas of Typography · 0123456789
Longhand · keeps the other inherited variants
Atlas of Typography · 0123456789
normal resets the subproperties to normal; none sets ligatures to none and the others to normal. Neither means “remove every font feature”. In a list, do not combine normal/none with other variants or mutually exclusive options such as lining-nums oldstyle-nums: the entire declaration would be invalid.
The playground covers caps, ligatures, numeric, east-asian and position. The current specification also includes alternates and emoji in the shorthand; check their support separately. The custom selector is a lab mode, not a CSS value. font-variant does not replace font-style, font-weight or font-stretch.
Small capitals and capital variants
small-caps uses small capitals for lowercase letters; all-small-caps also affects uppercase letters. These are typographic forms, not an uppercase conversion of the text. The original spelling remains available when copied.
The same phrase, three treatments
font-variant-caps: normal
Atlas of Typography
font-variant-caps: small-caps
Atlas of Typography
font-variant-caps: all-small-caps
Atlas of Typography
petite-caps/all-petite-caps request smaller capitals; unicase mixes forms of a single height and titling-caps requests title variants. Differences depend on the font. Browsers may synthesize small capitals; font-synthesis: none can prevent this when evaluating real outlines. Avoid long paragraphs in small capitals and retain strong/em for semantic emphasis.
Ligatures and contextual alternates
A ligature can represent several characters with one combined outline. common-ligatures and no-common-ligatures control common ones, such as fi or fl when offered by the font. No ligature characters are inserted into the HTML.
Letter pairs with and without common ligatures
font-variant-ligatures: normal
office · affinity · difficult · fi fl ffi
font-variant-ligatures: no-common-ligatures
office · affinity · difficult · fi fl ffi
font-variant-ligatures: common-ligatures discretionary-ligatures
office · affinity · difficult · fi fl ffi
normal usually enables common ligatures and contextual alternates, leaving discretionary and historical ligatures disabled. discretionary-ligatures, historical-ligatures and contextual have no-* counterparts. none disables these categories but does not remove ligatures required by a writing system. Avoid disabling typographic features globally to resolve an isolated case.
Figures for text, amounts and fractions
Figure style and spacing are independent choices: lining-nums aligns figures by height; oldstyle-nums allows ascenders and descenders. proportional-nums uses variable widths; tabular-nums requests the same advance width for every digit.
Compare 11111 and 88888 at the same size
font-variant-numeric: lining-nums proportional-nums
11111
88888
0123456789
font-variant-numeric: lining-nums tabular-nums
11111
88888
0123456789
font-variant-numeric: oldstyle-nums proportional-nums
11111
88888
0123456789
Local features · diagonal-fractions / ordinal / slashed-zero
1/2 · 1st · 0O
For amount columns, combine lining-nums tabular-nums with end alignment and consistent decimal formatting: tabular-nums alone does not align separators, signs or amounts of different lengths. diagonal-fractions and stacked-fractions are alternatives; scope them to the fraction to avoid shrinking other figures. They do not create accessible mathematical structure. ordinal and slashed-zero do not change the original characters.
East Asian forms and widths
jis78/jis83/jis90/jis04 request Japanese variants; simplified/traditional request glyph forms. They do not translate text or convert its encoding. Choose the right language and content before adjusting presentation.
A Japanese sample and its widths
font-variant-east-asian: normal
骨 直 令 · アイウ · ABC 123
font-variant-east-asian: jis04 full-width
骨 直 令 · アイウ · ABC 123
font-variant-east-asian: proportional-width
骨 直 令 · アイウ · ABC 123
One form variant, one width variant and ruby can be combined. The ruby value requests glyphs suitable for small annotations; it creates no annotations and does not replace ruby/rt elements. The playground selects one value at a time; the example combines jis04 full-width to teach composition without expanding the controls.
Subscripts and superscripts with meaning
Keep sub and sup in HTML to express subscript or superscript meaning. font-variant-position: sub/super requests smaller, shifted glyphs within the font box; it does not move that box’s baseline.
Compare sub/sup and font glyphs
Reference · native sub and sup
H2O · x2
Native request · verify the font glyphs
H2O · x2
The specification requires synthesis of the whole run when positional glyphs are missing, but BCD records missing synthesis in Chrome and Safari for sub/super. Before using the example’s reset in production, verify the effective font and every character; if you cannot guarantee them, keep the first row’s native presentation.
This scene compares real requests; system-ui does not guarantee these glyphs on every device either. Position is inherited: apply it only to the appropriate fragment. Keep sub/sup and their meaning; @supports alone cannot determine whether removing native sizing and alignment is safe.
Common mistakes
A variant makes no visible difference
- Expected result
- See an available typographic feature.
- Cause
- Alternate glyphs are missing or another font is rendering those characters.
- Solution
- Check the rendered font, its features and the language. Test relevant characters and keep a readable presentation when there is no difference.
Adding ligatures clears tabular figures
- Expected result
- Keep the previous variants.
- Cause
- A new font-variant declaration has reset the omitted components.
- Solution
- Change font-variant-ligatures or write the full set. Also check later font shorthands and cascade order.
The property says tabular, but digits remain proportional
- Expected result
- Apply the requested spacing.
- Cause
- Besides possible font limitations, font-feature-settings can impose conflicting low-level features.
- Solution
- Prefer font-variant-* for these features. Inspect and remove overrides such as "tnum" 0 before attributing the result to the browser.
Support and compatibility
MDN lists font-variant and the five subproperties covered here as Baseline Widely Available, with partial limitations in position: BCD records sub/super without synthesis of missing glyphs in Chrome and Safari. Check values, combinations and the font; the overall label does not guarantee each result.
The six scenes use native HTML/CSS and local or generic fonts; they do not download a font guaranteeing every variant. @supports checks syntax, getComputedStyle reports computed values and font tools help identify the actual resource. Also review reading, fallback and text enlarged to 200%.