CSS Property font-variant

This property defines small-caps text.


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

CSS Syntax

font-variant: normal | small-caps | inherit

Property Values

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

Browser compatibility

font-variant Yes Yes Yes Yes Yes


An example showing how to use font-variant CSS property.

p {<!--   w w w. jav a2 s  .c  o  m-->
  font-variant: normal;

span.smallcaps {
  font-variant: small-caps;

<p class="one">a normal font, but then 
      <span class="smallcaps">there are some small caps</span> 
      in the middle.</p>

Click to view the demo