asp.net.ph

Skip Navigation Links

font-variant Attribute | fontVariant Property

CSS Attributes Index   Font Attributes


Sets or retrieves whether the object’s text is small capitals.

Syntax


CSS { font-variant: 'normal' | 'small-caps' }
Script object.style.fontVariant = sVariant ]

Possible Values


normal The font is normal.
small-caps The font is set in small capitals.

The property is read/write with a default value of normal; the CSS attribute is inherited.

Remarks

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

Example

The following examples demonstrate use of inline event handlers to dynamically set an element’s font-variant characteristics. Both methods yield the same effect.

The sample below defines font-variant style attributes in an embedded stylesheet, and invokes calls to the stylesheet in response to mouse events.

<style type="text/css">
<!--
   .scaps { font-variant: small-caps }
-->
</style>
...
<p onmouseover="this.className='scaps'"
   onmouseout="this.className=''">
   ...
</p>

 Show me 

The sample below uses inline event handlers to dynamically set an object’s fontVariant property in response to mouse events.

<p onmousedown="this.style.fontVariant='small-caps'"
   onmouseup="this.style.fontVariant='normal'">
   ...
</p>

 Show me 

See Also

font, @font-face Rule, font-family, font-size, font-style, font-weight



© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note