CSS Property font-variant








This property defines small-caps text.

Summary

ItemValue
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

Example

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>

Click to view the demo