View video tutorial

CSS Font-Variant

CSS

This property is used to specifies how to set font variant.

CSS font-variant

➔ The font-variant property is used to specifies how to set font variant of an element.

Syntax

font-variant: normal|small-caps|initial|inherit;

Property values

Value Description
normal Displays text in a simple font face. This is default.
small-caps Displays lowercase letters as uppercase letters in a smaller font size than the original uppercase letters in the text.
initial Sets the property to its default value.
inherit The element inherits the property value from its parent element.

Example

#p1 {
  font-variant: normal;   
}
#p2 {
  font-variant: small-caps; 
}
Try it Now »

Click on the "Try it Now" button to see how it works.