font-variant Attribute | fontVariant Property

DHTML, HTML, & CSS

font-variant Attribute | fontVariant Property


Sets or retrieves whether the text of the object is in small capital letters.

Syntax

HTML{ font-variant: sVariant }
Scriptingobject.style.fontVariant [ = sVariant ]

Possible Values

sVariant String that specifies one of the following values:
normalFont is normal.
small-capsFont is in small capital letters.

The property is read/write with a default value of normal; the cascading style sheets (CSS) attribute is inherited.

Expressions can be used in place of the preceding value(s), as of Microsoft® Internet Explorer 5. For more information, see dynamic propertiesInternet Link.

Remarks

Internet Explorer 4.0 renders small-caps as uppercase letters in a smaller size.

Example

The following examples use the font-variant attribute and the fontVariant property to change the font to small capitals.

This example uses P as a selector in an embedded (global) style sheet to set the font style to small-caps in all paragraphs.

Sample Code

<P STYLE="font-variant:small-caps">

This feature requires Internet Explorer 4.0 or later. Click the icon below to install the latest version. Then reload this page to view the sample.
Microsoft Internet Explorer

This example uses inline scripting to set the font style to small-caps when an onmousedown event occurs.

<DIV onmousedown="this.style.fontVariant='small-caps'">

This feature requires Internet Explorer 4.0 or later. Click the icon below to install the latest version. Then reload this page to view the sample.
Microsoft Internet Explorer

Applies To

[ Object Name ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:
Version data is listed when the mouse hovers over a link, or the link has focus.
A, ADDRESS, B, BIG, BLOCKQUOTE, BODY, BUTTON, CAPTION, CENTER, CITE, CODE, COL, COLGROUP, currentStyle, custom, DD, DFN, DIR, DIV, DL, DT, EM, FIELDSET, FORM, Hn, HTML, I, IMG, INPUT type=button, INPUT type=checkbox, INPUT type=file, INPUT type=image, INPUT type=password, INPUT type=radio, INPUT type=reset, INPUT type=submit, INPUT type=text, ISINDEX, KBD, LABEL, LEGEND, LI, LISTING, MARQUEE, MENU, OL, P, PLAINTEXT, PRE, runtimeStyle, S, SAMP, SELECT, SMALL, SPAN, STRIKE, STRONG, style, SUB, SUP, TABLE, TBODY, TD, TEXTAREA, TFOOT, TH, THEAD, TR, TT, U, UL, VAR, XMP

See Also

font


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? write us!Internet Link

© 1999 microsoft corporation. all rights reserved. terms of useInternet Link.