font-variant

Description

This property defines small-caps text.

ItemValue
Initial value normal
Inherited Yes.
Version CSS1
JavaScript syntax object.style.fontVariant="small-caps"
Applies to All elements.

Syntax and Property Values


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

Example


<!DOCTYPE HTML>
<html>
<head>
  <style>
p {<!--   ww w  .  j av a 2  s. c om-->
  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>

Click to view the demo

The code above generates the following result.

font-variant




















Home »
  HTML CSS »
    HTML CSS Reference »




HTML Tag Reference
CSS Reference
CSS Selector Reference
Encoding Reference