Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Style fontVariant Property

Style fontVariant Property

Style Object Reference 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

Internet ExplorerFirefoxOperaGoogle ChromeSafari

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:

Runoob Tutorial(runoob.com)

This is some text.

THIS IS SOME TEXT.


Try it »


Style Object Reference The Style object