CSS

🎯 What is CSS font-variant-caps?

The font-variant-caps property in CSS controls how uppercase and lowercase letters are displayed using alternative capitalization styles provided by a font.

This property allows you to create more elegant and professional typography by displaying text in styles such as small caps, petite caps, or unicase.

πŸ’‘ In simple terms, font-variant-caps changes the appearance of letters without modifying the actual text content.

πŸ”§ Syntax

CSS

selector { 
    font-variant-caps: value; 
}
                

Example

CSS

p { 
    font-variant-caps: small-caps; 
}
                

🧩 Property Values

βœ” normal

This is the default value.

No special capitalization style is applied, and the text appears exactly as written.

CSS

p { 
    font-variant-caps: normal; 
}
                

βœ” small-caps

Converts lowercase letters into smaller uppercase letters while keeping original uppercase letters unchanged.

Example:

css text

Displays similar to:

CSS TEXT

Lowercase letters become smaller capital letters.

CSS

p { 
    font-variant-caps: small-caps; 
}
                

βœ” all-small-caps

Displays both uppercase and lowercase letters using the small-caps style.

Example:

Css Text

Displays as:

CSS TEXT

with all letters appearing in a uniform small-cap style.

CSS

p { 
    font-variant-caps: all-small-caps; 
}
                

βœ” petite-caps

Uses a smaller version of small-caps provided by some advanced fonts.

⚠️ Font support is limited. If unsupported, browsers usually fall back to small-caps.

CSS

p { 
    font-variant-caps: petite-caps; 
}
                

βœ” all-petite-caps

Displays all letters using the petite-caps style.

If the font does not support petite caps, browsers typically fall back to all-small-caps.

CSS

p { 
    font-variant-caps: all-petite-caps; 
}
                

βœ” unicase

Displays uppercase and lowercase letters using a unified capitalization style.

This value works best with fonts that include dedicated unicase glyphs.

CSS

p { 
    font-variant-caps: unicase; 
}
                

βœ” initial

Resets the property to its default value.

CSS

p { 
    font-variant-caps: initial; 
}
                

βœ” inherit

Inherits the font-variant-caps value from its parent element.

CSS

p { 
    font-variant-caps: inherit; 
}
                

πŸ“Š Value Summary

Value Description
normal Displays normal text
small-caps Converts lowercase letters to small capitals
all-small-caps Displays all letters as small capitals
petite-caps Uses a smaller version of small capitals
all-petite-caps Displays all letters as petite capitals
unicase Uses a unified capitalization style
initial Resets to the default value
inherit Inherits the value from the parent element

🎨 Practical Example

HTML

CSS

<p class="small">
    hello world
</p>

<p class="all-small">
    HeLLo WoRLd
</p>
                

CSS

CSS

.small { 
    font-variant-caps: small-caps; 
} 

.all-small { 
    font-variant-caps: all-small-caps; 
}
                

Result

The first paragraph converts only lowercase letters into small capitals, while the second paragraph displays all characters using the small-caps style.

🌐 Browser Support

The small-caps value is widely supported in modern browsers. However, advanced values such as petite-caps, all-petite-caps, and unicase depend heavily on font support and may not be available in every typeface.

For the best compatibility, use:

font-variant-caps: small-caps;

πŸ“Œ Conclusion

The font-variant-caps property is a powerful typography feature that enhances text presentation by applying specialized capitalization styles. It is commonly used in headings, logos, book titles, navigation menus, and professional editorial designs where elegant typography is important.