CSS font-variant
property specifies whether the text should be displayed in small-caps format or not.
In small-caps format, the text is displayed in uppercase letters. But, the font size of the converted letters is somewhat smaller than the regular uppercase letters.
Example:
.p1{ font-variant: normal; } .p2{ font-variant: small-caps; }
CSS Syntax
The font-variant
property has the following syntax:
font-variant: normal|small-caps|initial|inherit;
Property Values
The font-variant
property accepts the following values:
normal | This is the default value. The text is displayed normally. |
small-caps | The text is displayed in uppercase letters with a font size smaller than the regular uppercase letters. |
initial | sets the font-variant property to its default value(normal). |
inherit | Inherits the font-variant property from the parent element. |
General Info
Default Value | normal |
Inherited | Yes |
JavaScript Usage | element.style.fontVariant = “small-caps”; |