W3docs

CSS font-variant-caps Property

The font-variant-caps CSS property enables the selection of the alternate glyphs for small, petite capitals and titling. See the values and try examples.

In CSS1 and CSS2, the font-variant property specified small caps. In CSS3, it became a shorthand for several properties, including font-variant-caps. This property allows selecting alternate glyphs for small, petite capitals, and titling. Common values include:

  • normal
  • small-caps
  • all-small-caps
  • petite-caps
  • all-petite-caps
  • unicase
  • titling-caps

When a given font involves capital letter glyphs that are of different size, the font-variant-caps property selects the most suitable ones. If small capital glyphs are not available, they are rendered using uppercase glyphs.

Actual rendering depends on the font's OpenType feature support.

Initial Valuenormal
Applies toAll elements. It also applies to ::first-letter and ::first-line.
InheritedYes.
AnimatableNo.
VersionCSS3
DOM Syntaxobject.style.fontVariantCaps = "petite-caps";

Syntax

Syntax of CSS font-variant-caps Property

font-variant-caps: normal | small-caps | all-small-caps | petite-caps | all-petite-caps | unicase | titling-caps;

Example of the font-variant-caps property:

Example of CSS font-variant-caps Property with all-small-caps, small-caps, and normal values

<!DOCTYPE html>
<html>
  <head>
    <title>The title of the document </title>
    <style>
      .all-small-caps {
        font-variant-caps: all-small-caps;
      }
      .small-caps {
        font-variant-caps: small-caps;
      }
      .normal {
        font-variant-caps: normal;
      }
    </style>
  </head>
  <body>
    <h2>Font-variant-caps property example</h2>
    <p class="all-small-caps">
      The font-variant-caps CSS property controls the use of alternate glyphs for capital letters.
    </p>
    <p class="small-caps">Small caps!</p>
    <p class="normal">Normal caps!</p>
  </body>
</html>

Result

CSS font-variant-caps Property

Values

ValueDescription
normalThe use of alternate glyphs is not activated.
small-capsDisplays small capitals. Small-caps glyphs use the form of uppercase letters, but are reduced to the size of lowercase letters.
all-small-capsDisplays small capitals for both uppercase and lowercase letters.
petite-capsDisplays petite capitals.
all-petite-capsDisplays petite capitals for both uppercase and lowercase letters.
unicaseDisplays a mixture of small capitals for uppercase letters with normal lowercase letters.
titling-capsDisplays titling capitals.

Note: initial and inherit are CSS-wide keywords and can be used with any CSS property.

Browser Compatibility

BrowserSupport
Chrome48+
Edge79+
Firefox34+
Safari9.1+
Opera35+

Note: font-variant-caps is part of the font-variant shorthand. When using the shorthand, explicitly include font-variant-caps to preserve its value, as other shorthand values may override it.

Practice

Practice

What does the CSS 'font-variant-caps' property do?