Style fontVariant Property
The Style object
Definition and Usage
The fontVariant property sets or returns whether the font is displayed in small caps.
This means all lowercase letters are converted to uppercase, but the letters appear in a smaller font size than the rest of the text.
Syntax
Sets the fontVariant property:
Object.style.fontVariant="normal|small-caps|inherit"
Returns the fontVariant property:
Object.style.fontVariant
| Value | Description |
|---|---|
| normal | Default. The font is normal (normal). |
| small-caps | The font is displayed in small caps. |
| inherit | The fontVariant property value is inherited from the parent element. |
Browser support





All major browsers support the fontVariant property.
**Note:** IE7 and earlier versions do not support the "inherit" value. IE8 supports "inherit" only if a !DOCTYPE is specified. IE9 supports "inherit".
Example
Example
Changes the font to small caps:
This is some text.
THIS IS SOME TEXT.
Try it »
The Style object