English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
font-The variant attribute sets the font display text to small uppercase letters, which means that all lowercase letters will be converted to uppercase, but the letters using small uppercase letters are smaller in font size compared to the rest of the text
The following table provides usage instructions and version history of this attribute, as well as the syntax of using this attribute in the JavaScript script.
Default value: | normal |
---|---|
Applicable to: | All elements |
Inheritance: | Yes |
Can be animated: | No.Please see Animation attribute. |
Version: | CSS 1,2,3 |
The syntax of this attribute is as follows:
font-variant: normal | small-caps | initial | inherit
The following examples demonstrate how to use font-variant attribute.
p { font-variant: small-caps; }Test and see‹/›
The following table describes the value of this attribute.
Value | Description |
---|---|
normal | Specify a normal font. |
small-caps | Specify the font marked as lowercase. If the lowercase font cannot be used, the browser will simulate this variant, using a regular font, and replace lowercase letters with smaller uppercase letters. |
initial | Set this attribute to its default value. |
inherit | If specified, the associated elements adopt the font of their parent element font-The variant attribute values. |
Note: In small-In caps font, lowercase letters look similar to uppercase letters but are smaller in size, and the proportions are slightly different.
font-Browser compatibility of the variant attribute, the numbers in the table below represent the minimum version number of the browser that supports this attribute; all mainstream browsers support this attribute.
|
Please refer to the following tutorials:CSS font,CSS text.
Related attributes and rules:font,font-style,font-weight,font-size,line-height,font-family,@font-face.