CSS font-variant property
Example
Set a paragraph to small-caps font:
p.small
{
font-variant:small-caps;
}
Try it »
Property definition and usage
The font-variant property sets text to display in small-caps font, which means all lowercase letters are converted to uppercase, but the letters using small-caps font are smaller in size compared to the rest of the text
The font-variant property is mainly used to define small-caps text
| Default value: | normal |
|---|---|
| Inherited: | yes |
| Version: | CSS1 |
| JavaScript syntax: | object.style.fontVariant="small-caps" |
Browser support
The numbers in the table indicate the first browser version that supports this property.
| property | |||||
|---|---|---|---|---|---|
| font-variant | 1.0 | 4.0 | 1.0 | 1.0 | 3.5 |
Attribute values
| Value | Description |
|---|---|
| normal | Default value. The browser displays a standard font. |
| small-caps | The browser displays a small-caps font. |
| inherit | Specifies that the value of the font-variant property should be inherited from the parent element. |
Related Articles
CSS Tutorial: CSS Font
CSS Reference Manual: font property