Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / CSS

font-variant-numeric — numeric variants

font-variant-numeric selects typographic forms for digits, fractions, and ordinal markers. Its visible effect depends on features available in the font being used.

Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required

Syntax

font-variant-numeric: normal | [ <numeric-figure-values> || <numeric-spacing-values> || <numeric-fraction-values> || ordinal || slashed-zero ];
<numeric-figure-values> = lining-nums | oldstyle-nums
<numeric-spacing-values> = proportional-nums | tabular-nums
<numeric-fraction-values> = diagonal-fractions | stacked-fractions

font-variant-numeric is inherited; its initial value, normal, enables none of the listed features. The property selects typographic forms, not number formatting.

lining-nums selects uniform-height figures, while oldstyle-nums selects figures with ascenders and descenders. proportional-nums selects variable digit widths; tabular-nums selects equal digit widths, useful in columns.

diagonal-fractions selects diagonal fractions; stacked-fractions selects stacked fractions. ordinal selects ordinal letter forms; slashed-zero selects a slashed zero.

Combine options from different groups with spaces, in any order; choose at most one from each pair. normal stands alone. A conflicting pair such as lining-nums oldstyle-nums invalidates the declaration.

Missing font features may leave the appearance unchanged. Apply fractions locally, not to an entire paragraph. The example requests lining, equal-width figures, but their appearance needs a separate visual check.

Examples

<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>Numeric variants</title>
<style>
  .numbers {
    font-family: serif;
    font-size: 32px;
    font-variant-numeric: lining-nums tabular-nums;
  }
</style>
<div class="numbers">1111<br>8888<br>2026</div>
</html>

Result

1111
8888
2026

The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.

Sources