CSS Attributes Index Font Attributes
Sets or retrieves whether the object’s text is small capitals.
CSS |
{ font-variant: 'normal' | 'small-caps' } |
Script |
object.style.fontVariant = sVariant ] |
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.
Microsoft® Internet Explorer® 4.0 renders small-caps as uppercase letters in a smaller size.
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
font, @font-face Rule, font-family, font-size, font-style, font-weight