CSS font-variant-caps Property
The font-variant-caps property controls the use of alternate capital letterforms, including small capitals, petite capitals, unicase, and titling capitals.
These variations are commonly provided through OpenType font features. The property changes how letters are displayed without changing the underlying text. Some effects require specific font features, while small capitals may be synthesized when genuine glyphs are unavailable.
font-variant-caps Syntax
The font-variant-caps property accepts one capitalization keyword at a time.
Basic Syntax
selector {
font-variant-caps: normal;
}
Small Capitals
selector {
font-variant-caps: small-caps;
}
All Small Capitals
selector {
font-variant-caps: all-small-caps;
}
Titling Capitals
selector {
font-variant-caps: titling-caps;
}
CSS-Wide Keywords
.example {
font-variant-caps: inherit;
}
.example {
font-variant-caps: initial;
}
.example {
font-variant-caps: unset;
}
.example {
font-variant-caps: revert;
}
.example {
font-variant-caps: revert-layer;
}
Capitalization values cannot be combined in the same declaration. For example, small-caps and titling-caps are alternative settings rather than independent features.
Property Values
The property supports the following capitalization variants:
| Value | Description |
|---|---|
normal |
Uses the font's normal capitalization behavior. |
small-caps |
Displays lowercase letters using small-capital letterforms. |
all-small-caps |
Displays lowercase and uppercase letters using small-capital letterforms. |
petite-caps |
Requests petite-capital letterforms for lowercase letters. |
all-petite-caps |
Requests petite-capital letterforms for lowercase and uppercase letters. |
unicase |
Requests a mixture of uppercase and lowercase-style glyphs designed to have a consistent visual appearance. |
titling-caps |
Requests capital letterforms designed for headings and large display text. |
Property Characteristics
| Characteristic | Value |
|---|---|
| Initial value | normal |
| Inherited | Yes |
| Applies to | All elements and text |
| Computed value | As specified |
| Animation type | Discrete |
| Percentages | Not applicable |
Most capitalization variants depend on the selected font's OpenType features. When a requested feature is unavailable, the browser may use a defined fallback behavior or display the normal glyphs.
How It Works
The font-variant-caps property requests alternate capitalization glyphs from the selected font.
Normal Letterforms
.heading {
font-variant-caps: normal;
}
Request Small Capitals
.heading {
font-variant-caps: small-caps;
}
The browser attempts to display lowercase letters using small-capital glyphs.
Font Feature Selection
When the font contains suitable OpenType features, the browser uses those features to select the requested letterforms.
Missing Glyphs
If genuine small-capital glyphs are unavailable, the browser may synthesize small capitals from uppercase letterforms when synthesis is permitted.
Other Capitalization Variants
Petite capitals, unicase, and titling capitals generally require the corresponding glyphs in the font. These variants are not universally available.
Important Consideration
The property changes glyph presentation, not the actual characters stored in the HTML document.
The normal Value
The normal value uses the font's default capitalization behavior.
Basic Example
.paragraph {
font-variant-caps: normal;
}
Reset Small Capitals
.heading {
font-variant-caps: small-caps;
}
.heading .regular-text {
font-variant-caps: normal;
}
Default Behavior
The normal value is the initial setting. It does not request any special capitalization variant.
Important Consideration
Use normal when a descendant element should display ordinary letterforms instead of inheriting a parent's capitalization variant.
Small Capitals
The small-caps value requests small-capital glyphs for lowercase letters while retaining ordinary uppercase glyphs.
Basic Example
.heading {
font-variant-caps: small-caps;
}
HTML Example
<h2 class="small-caps-heading">Creative Typography</h2>
CSS Example
.small-caps-heading {
font-family: Georgia, serif;
font-variant-caps: small-caps;
}
OpenType Feature
Genuine small capitals commonly use the OpenType smcp feature.
Synthetic Small Capitals
When genuine small-capital glyphs are unavailable, browsers may approximate them by reducing uppercase glyphs. These synthetic forms may have thinner strokes than genuine small capitals.
Important Consideration
Small capitals are useful for headings, abbreviations, and other short text. Genuine small-capital glyphs generally provide more consistent proportions than synthetic versions.
All Small Capitals
The all-small-caps value requests small-capital glyphs for both lowercase and uppercase letters.
Basic Example
.heading {
font-variant-caps: all-small-caps;
}
HTML Example
<h2 class="all-small-caps-heading">Creative Typography</h2>
CSS Example
.all-small-caps-heading {
font-family: Georgia, serif;
font-variant-caps: all-small-caps;
}
OpenType Features
Genuine all-small-capital styling commonly uses the OpenType smcp and c2sc features.
Difference from small-caps
| Value | Behavior |
|---|---|
small-caps |
Requests small capitals for lowercase letters while leaving uppercase letters in their normal forms. |
all-small-caps |
Requests small capitals for both lowercase and uppercase letters. |
Important Consideration
When the font lacks genuine small capitals, browsers may synthesize the requested appearance. The results can differ between fonts and browsers.
Petite Capitals
The petite-caps value requests petite-capital letterforms for lowercase letters.
Basic Example
.heading {
font-variant-caps: petite-caps;
}
HTML Example
<h2 class="petite-caps-heading">Creative Typography</h2>
CSS Example
.petite-caps-heading {
font-family: "Example Serif", serif;
font-variant-caps: petite-caps;
}
OpenType Feature
Petite capitals commonly use the OpenType pcap feature.
Fallback Behavior
If the font lacks petite capitals, the browser may fall back to small-capital behavior.
Important Consideration
Petite capitals are less common than small capitals. Use a font known to support the feature when the distinction is important to the design.
All Petite Capitals
The all-petite-caps value requests petite-capital glyphs for both lowercase and uppercase letters.
Basic Example
.heading {
font-variant-caps: all-petite-caps;
}
HTML Example
<h2 class="all-petite-caps-heading">Creative Typography</h2>
CSS Example
.all-petite-caps-heading {
font-family: "Example Serif", serif;
font-variant-caps: all-petite-caps;
}
OpenType Features
All petite capitals commonly use the OpenType pcap and c2pc features.
Fallback Behavior
If petite-capital features are unavailable, the browser may use all-small-capital behavior instead.
Important Consideration
Because this feature is not available in every font, test the selected typeface before relying on the intended appearance.
Unicase
The unicase value requests a font's unicase letterforms, which combine uppercase and lowercase-style designs into a more uniform visual system.
Basic Example
.heading {
font-variant-caps: unicase;
}
HTML Example
<h2 class="unicase-heading">Creative Typography</h2>
CSS Example
.unicase-heading {
font-family: "Example Display", sans-serif;
font-variant-caps: unicase;
}
OpenType Feature
Unicase uses the OpenType unic feature.
Font Availability
Unicase forms are generally found in specialized display fonts rather than ordinary text fonts.
Important Consideration
Unicase is a visual treatment. It does not convert the actual text to uppercase or lowercase.
Titling Capitals
The titling-caps value requests capital letterforms designed for titles and large display text.
Basic Example
.heading {
font-variant-caps: titling-caps;
}
HTML Example
<h2 class="titling-heading">Creative Typography</h2>
CSS Example
.titling-heading {
font-family: "Example Display", serif;
font-variant-caps: titling-caps;
}
OpenType Feature
Titling capitals use the OpenType titl feature.
Typical Uses
Titling capitals are intended for display typography, including headings, titles, and other prominent text.
Important Consideration
The feature only affects characters for which the font provides titling forms. It does not automatically convert lowercase letters to uppercase.
Font Synthesis
Browsers may synthesize small-capital letterforms when a font does not contain genuine small capitals.
Allow Synthetic Small Capitals
.heading {
font-variant-caps: small-caps;
font-synthesis-small-caps: auto;
}
Prevent Synthetic Small Capitals
.heading {
font-variant-caps: small-caps;
font-synthesis-small-caps: none;
}
Using the font-synthesis Shorthand
.heading {
font-variant-caps: small-caps;
font-synthesis: none;
}
This disables the synthesis types controlled by the font-synthesis shorthand, including synthetic small capitals.
Genuine vs. Synthetic Small Capitals
| Type | Description |
|---|---|
| Genuine small capitals | Specially designed glyphs provided by the font. |
| Synthetic small capitals | Approximated by the browser, often by scaling uppercase glyphs. |
Important Consideration
Disabling synthesis does not add missing glyphs. If the font lacks genuine small capitals, the browser may display ordinary letterforms instead.
font-variant-caps vs. text-transform
The font-variant-caps and text-transform properties affect text presentation in different ways.
Using font-variant-caps
.heading {
font-variant-caps: small-caps;
}
This requests specially designed small-capital glyphs for lowercase letters.
Using text-transform
.heading {
text-transform: uppercase;
}
This displays lowercase text using uppercase characters without changing the underlying HTML text.
Comparison
| Property | Purpose |
|---|---|
font-variant-caps |
Requests alternate capitalization glyphs from the font. |
text-transform |
Controls the displayed capitalization of text. |
Combining the Properties
.heading {
text-transform: uppercase;
font-variant-caps: titling-caps;
}
This displays the text in uppercase and requests titling-capital glyphs when the font provides them.
Important Consideration
Use text-transform when the goal is uppercase or lowercase presentation. Use font-variant-caps when the goal is a specific typographic capitalization style.
The font-variant Shorthand
The font-variant shorthand can set capitalization variants together with other font variant features.
Longhand Example
.heading {
font-variant-caps: small-caps;
}
Shorthand Example
.heading {
font-variant: small-caps;
}
Combining Small Capitals and Numbers
.heading {
font-variant: small-caps oldstyle-nums;
}
Combining Small Capitals and Ligatures
.heading {
font-variant: small-caps common-ligatures;
}
Shorthand Reset Behavior
.heading {
font-variant-caps: small-caps;
font-variant: tabular-nums;
}
The later shorthand resets font-variant-caps to normal because the capitalization variant is not included.
Preserving Both Features
.heading {
font-variant: small-caps tabular-nums;
}
Important Consideration
Use the longhand property when changing only capitalization. Use the shorthand when defining several font variant settings together.
Using font-feature-settings
The font-feature-settings property provides direct access to OpenType font feature tags.
High-Level Small Capitals
.heading {
font-variant-caps: small-caps;
}
Low-Level Small Capitals
.heading {
font-feature-settings: "smcp" 1;
}
High-Level All Small Capitals
.heading {
font-variant-caps: all-small-caps;
}
Low-Level All Small Capitals
.heading {
font-feature-settings: "smcp" 1, "c2sc" 1;
}
Titling Capitals
.heading {
font-feature-settings: "titl" 1;
}
Preferred Approach
Use font-variant-caps for common capitalization features. Use font-feature-settings when direct control over specific OpenType features is necessary.
Important Consideration
Low-level feature settings can interact with higher-level font properties. Prefer the high-level property when it provides the required functionality.
Font Support and Fallbacks
The visible results of font-variant-caps depend on the selected font and its supported capitalization features.
Fonts with Genuine Small Capitals
Some professional text and display fonts contain specially designed small-capital glyphs.
Fonts Without Small Capitals
.heading {
font-family: Arial, sans-serif;
font-variant-caps: small-caps;
}
When genuine small capitals are unavailable, the browser may synthesize them if permitted.
Specialized Capitalization Features
Petite capitals, unicase, and titling capitals generally require fonts with the corresponding OpenType features.
Fallback Fonts
.heading {
font-family: "Example Serif", Georgia, serif;
font-variant-caps: petite-caps;
}
If the primary font is unavailable, the fallback font may not provide petite capitals. The browser may use a fallback capitalization behavior.
Custom Web Fonts
When using a custom font, check its OpenType feature list to confirm which capitalization variants are supported.
Important Consideration
Browser support for a CSS value does not guarantee that the selected font contains the necessary glyphs.
Inheritance
The font-variant-caps property is inherited. Child elements receive the parent's capitalization variant unless they specify their own value.
Inherited Small Capitals
.heading-group {
font-variant-caps: small-caps;
}
<div class="heading-group">
<h2>Typography <span>Reference</span></h2>
</div>
Override a Child Element
.heading-group {
font-variant-caps: small-caps;
}
.heading-group .regular-text {
font-variant-caps: normal;
}
Explicit Inheritance
.child {
font-variant-caps: inherit;
}
Reset to Initial Value
.child {
font-variant-caps: initial;
}
Important Consideration
Inherited capitalization variants may affect headings, links, labels, and other descendant text. Apply them to appropriately scoped elements.
font-variant-caps Example
This example compares normal capitalization with small capitals and all-small-capital styling.
HTML Example
<div class="font-variant-caps-demo">
<p class="demo-label">Normal</p>
<p class="normal-text">Creative Typography</p>
<p class="demo-label">Small capitals</p>
<p class="small-caps-text">Creative Typography</p>
<p class="demo-label">All small capitals</p>
<p class="all-small-caps-text">Creative Typography</p>
</div>
CSS Example
.font-variant-caps-demo {
font-family: Georgia, serif;
}
.font-variant-caps-demo p {
margin: 0 0 16px;
}
.font-variant-caps-demo .demo-label {
font: 600 13px/1.4 Arial, sans-serif;
}
.font-variant-caps-demo .normal-text,
.font-variant-caps-demo .small-caps-text,
.font-variant-caps-demo .all-small-caps-text {
font-size: 28px;
line-height: 1.4;
}
.font-variant-caps-demo .normal-text {
font-variant-caps: normal;
}
.font-variant-caps-demo .small-caps-text {
font-variant-caps: small-caps;
}
.font-variant-caps-demo .all-small-caps-text {
font-variant-caps: all-small-caps;
}
Normal
Creative Typography
Small capitals
Creative Typography
All small capitals
Creative Typography
The first example uses ordinary letterforms. The second requests small capitals for lowercase letters, while the third requests small capitals for both lowercase and uppercase letters.
The exact appearance depends on the font. If genuine small-capital glyphs are unavailable, the browser may synthesize the requested forms.
Common Mistakes
The most common mistakes involve invalid value combinations, unsupported font features, and confusion with text transformation.
Combining Capitalization Values
.heading {
font-variant-caps: small-caps titling-caps;
}
This declaration is invalid because the property accepts only one capitalization value.
Using uppercase as a Value
.heading {
font-variant-caps: uppercase;
}
This declaration is invalid. Use text-transform: uppercase to display text in uppercase.
Using lowercase as a Value
.heading {
font-variant-caps: lowercase;
}
This declaration is invalid. Use text-transform: lowercase instead.
Expecting Every Font to Support Petite Capitals
Many fonts do not provide the pcap or c2pc OpenType features.
Expecting titling-caps to Convert Text to Uppercase
The titling-caps value requests alternate capital glyphs. It does not change lowercase text into uppercase.
Confusing Genuine and Synthetic Small Capitals
Synthetic small capitals may have different stroke weights and proportions from genuine small-capital glyphs.
Ignoring Shorthand Reset Behavior
.heading {
font-variant-caps: small-caps;
font-variant: tabular-nums;
}
The later shorthand resets the capitalization variant to normal.
Assuming Browser Support Guarantees Font Support
A browser may recognize unicase or titling-caps even when the selected font lacks those features.
Important Considerations
Keep the following points in mind when using the font-variant-caps property:
- Purpose: Controls alternate capitalization glyphs.
- Property type: Longhand of
font-variant. - Initial value:
normal. - Inheritance: The property is inherited.
- Applies to: All elements and text.
- normal: Uses ordinary capitalization glyphs.
- small-caps: Requests small capitals for lowercase letters.
- all-small-caps: Requests small capitals for lowercase and uppercase letters.
- petite-caps: Requests petite capitals for lowercase letters.
- all-petite-caps: Requests petite capitals for lowercase and uppercase letters.
- unicase: Requests a font's unicase glyph designs.
- titling-caps: Requests capital glyphs designed for display typography.
- Single value: Only one capitalization keyword can be specified at a time.
- OpenType: Genuine capitalization variants depend on supported font features.
- Font synthesis: Browsers may synthesize missing small-capital glyphs when permitted.
- Font support: Specialized variants are not available in every typeface.
- Text transformation: Use
text-transformfor uppercase or lowercase presentation. - Shorthand reset: A later
font-variantdeclaration may reset the property. - Accessibility: Use capitalization variants without reducing the readability of important text.
- Browser support: Check compatibility for specialized capitalization values.
Use font-variant-caps to select capitalization styles supported by the font. For the most consistent results, choose a typeface with genuine glyphs for the requested variant.
Browser Support
The CSS font-variant-caps property is Widely available in modern browsers, including Chrome, Edge, Firefox, and Safari.
Basic small-capital styling has broad support. Specialized variants such as petite capitals, unicase, and titling capitals depend on both browser support and the selected font's OpenType features.
Basic Example
.heading {
font-variant-caps: small-caps;
}
Feature Detection
@supports (font-variant-caps: all-small-caps) {
.heading {
font-variant-caps: all-small-caps;
}
}
Progressive Enhancement
.heading {
font-variant-caps: small-caps;
}
@supports (font-variant-caps: petite-caps) {
.heading {
font-variant-caps: petite-caps;
}
}
This example uses small capitals as a fallback and requests petite capitals when the browser recognizes the value.
Font Feature Availability
The @supports rule checks whether the browser recognizes the CSS declaration. It does not confirm that the selected font provides the requested capitalization glyphs.
For current compatibility information, visit Can I Use? and search for font-variant-caps.
Specifications
The font-variant-caps property is defined in the CSS Fonts Module, which describes capitalization variants and their relationships to OpenType font features.
CSS Fonts Module Level 4: font-variant-caps
The module also defines the font-variant shorthand, font synthesis controls, and other typographic features.
For additional explanations and examples, see MDN Web Docs.
