This property defines small-caps text.
Item | Value |
---|---|
Initial value | normal |
Inherited | Yes. |
Version | CSS1 |
JavaScript syntax | object.style.fontVariant="small-caps" |
Applies to | All elements. |
font-variant: normal | small-caps | inherit
The property values are listed in the following table.
Value | Description |
---|---|
normal | A normal font. Default value |
small-caps | A small-caps font |
inherit | Inherit the font variant from the parent element |
font-variant |
Yes | Yes | Yes | Yes | Yes |
An example showing how to use font-variant CSS property.
<!DOCTYPE HTML>
<html>
<head>
<style>
p {<!-- w w w. jav a2 s .c o m-->
font-variant: normal;
}
span.smallcaps {
font-variant: small-caps;
}
</style>
</head>
<body>
<p class="one">a normal font, but then
<span class="smallcaps">there are some small caps</span>
in the middle.</p>
</body>
</html>