CSS font-variant-caps

The font-variant-caps property in CSS allows you to control the appearance of the capital letters in text. It can be used to convert the capital letters to either small caps or all caps.

There are four possible values for the font-variant-caps property:

Let's see some examples to better understand how font-variant-caps works:

Result:

Lorem Ipsum Dolor Sit Amet

In this example, we have set the font-variant-caps property to small-caps. As a result, the text "Lorem Ipsum Dolor Sit Amet" is displayed with smaller capital letters.

Result:

Lorem Ipsum Dolor Sit Amet

Now, we have set the font-variant-caps property to all-small-caps. As a result, the text is displayed with all small caps.

Result:

Lorem Ipsum Dolor Sit Amet

Lastly, setting the font-variant-caps property to all-scroll-caps will display the text with all capital letters.