All Tech Tips

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

sVariantString that specifies or receives one of the following values.
normalDefault. Font is normal.
small-capsFont is in small capital letters.

The property is read/write for all objects except the following, for which it is read-only: currentStyle. The property has 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. .

Remarks

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

Examples

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.

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

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'">

Standards Information

This property is defined in Cascading Style Sheets (CSS), Level 1 (CSS1) .

Applies To

A, ADDRESS, B, BIG, BLOCKQUOTE, BODY, BUTTON, CAPTION, CENTER, CITE, CODE, COL, COLGROUP, currentStyle, CUSTOM, DD, defaults, 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, SMALL, SPAN, STRIKE, STRONG, style, SUB, SUP, TABLE, TBODY, TD, TEXTAREA, TFOOT, TH, THEAD, TR, TT, U, UL, VAR, XMP

See Also

font


Copyright © 2006 alltechtips.com. All rights reserved.

This website and the materials and information you find on this website are provided "as is", without warranty of any kind, either express or implied, including without limitation any warranty for information, services, or products provided through or in connection with the service and any implied warranties of merchantability, fitness for a particular purpose, expectation of privacy or non-infringement.