Font-variant - CSS Property
Summary of characteristics of the font-variant property
normal | none | small-caps | all-small-caps | petite-caps | all-petite-caps | titling-caps | unicasenormalDiscrète: during an animation, the font-variant property passes from one value to another without transition.Per grammar: serialization in the order of syntax. Values can be entered in any order.Description of the font-variant property.
Initially, in CSS2, the font-variant property simply defined the capitalization of characters (like small caps, for example). But it has evolved a lot:
in CSS3, font-variant defines many advanced typographic settings such as ligatures or character substitution. It is now a shorthand property that
corresponds to the following properties:
Not all values are necessarily specified, but those that aren't will be reset to their initial value. So ignoring a value doesn't leave it unchanged.
font-variant et les propriétés dérivées ci-dessus fonctionnent avec les polices du type OTF, WOFF ou WOFF2.
Exemples de Values for font-variant.
- font-variant: normal;
Default value. The
normalvalue initializes all individualfont-variantproperties to their initial value. - font-variant: none;
The value
nonesets thefont-variant-ligaturesproperty tononeand all the other individual properties to their initial value. - font-variant: common-ligatures small-caps oldstyle-nums ;
Example of a syntax defining the value of several individual properties. This writing is equivalent to:
font-variant-ligatures: common-ligatures; font-variant-position: initial; font-variant-caps: small-caps; font-variant-numeric: oldstyle-nums; font-variant-alternates: initial; font-variant-east-asian: initial; font-variant-emoji: initial; - font-variant: initial; (
normal) font-variant: inherit; font-variant: revert; font-variant: revert-layer; font-variant: revert-rule; font-variant: unset;Common values are presented on these pages:
initial,inherit,revert,revert-layer,revert-rule,unset.
Animation of the font-variant property.
All properties related to font-variant can be animated. Check each property's page to see examples of animations.
Simulator.
The simulator only offers values already defined in CSS2, which are generally well recognized by all browsers and can be used with all fonts.
But all values related to individual font-variant... properties are also accepted by the shorthand property font-variant.
Check out these different properties for more details and other simulators.
Browsers compatibility with font-variant..
The older values of font-variant (defined in CSS2) are well recognized by all current browsers. These are basically the values corresponding to
font-variant-caps (normal, small-caps, all-small-caps, etc.).
On the other hand, the new possibilities defined in CSS3 are less widely supported. Check the pages for individual properties for more details:
- Turning ligatures on or off with
font-variant-ligatures. - Managing exponents and indices with
font-variant-position. - Managing character capitalization (
font-variant-caps). - Number-specific presentations (fractions, for example):
font-variant-numeric. - Using alternative character forms (decorative, stylized, etc) with
font-variant-alternates. - Management of language-specific effects CJK (property
font-variant-east-asian). - And, even more recently, whether or not to display the icons associated with certain characters (
font-variant-emoji).
Moreover, all these features use the capabilities of OTF (OpenType Font) fonts, so they are very dependent on the font being used. Few fonts offer all the possibilities.
font-variant property. Shorthand property for all properties whose name starts with font-variant-....Notes:
(1) Only supports the small-caps and normal values.
font-variantproperty
(CSS 2)
Browsers on computers :
Mobile browsers :
Outdated or marginal browsers :

Internet Explorer

KaiOS Browser

Opéra Mobile

Opéra

Safari

Safari sur IOS

Firefox pour Androïd

Samsung Internet

Chrome

Edge

Firefox

Androïd Brower

Chrome pour Androïd

Baidu Browser

QQ Browser

UC Browser pour Androïd

Opéra mini
Historic of the font-variant property.
-
Cascading Style Sheets specification - Version 1
This first level of the CSS specification describes the mechanism of cascading style sheets. Authors and readers can add styles to documents. Mainly intended for formatting HTML documents, CSS allows defining colors, fonts, text formatting, spacing (margins), etc. The CSS language is easy to understand, readable, and easy to write; it uses common terms from desktop publishing.
Regardingfont-variant:
First definition of thefont-variantproperty, accepting only the values normalandsmall-caps.November 17, 1995Working Draft.November 12, 1996Proposed for recommendation.December 17, 1996Recommendation .September 13, 2018Old specification, declared obsolete. -
Cascading Style Sheets Level 2 - Revision 1 Specification
This level 2 of the specification describes the mechanism of cascading styles in CSS. This language is used to format HTML or XML documents. It supports media-specific style sheets so that authors can adapt the presentation of their documents for visual browsers, auditory devices, printers, braille devices, portable devices, etc.
Regardingfont-variant:
Addinginheritvalue.November 04, 1997Working Draft.March 24, 1998Proposed for recommendation.May 11, 1998Recommendation . -
CSS Fonts Module Level 3
This specification concerns fonts. A font contains the visual representation of characters. In its simplest form, it is just a matter of associating character codes with their shapes.
Within a typeface family, the shapes are defined but can vary in stroke thickness, slant, width, etc. The CSS propertiesfont-...allow choosing the final appearance of the characters.
Fonts can be located on the user's computer or downloaded.Regardingfont-variant:font-variantis now a shorthand property for setting values for properties whose names start withfont-variant....July 21, 1997Working Draft.October 03, 2013Candidate Recommendation.August 14, 2018Proposed for recommendation.September 20, 2018Recommendation . -
CSS Fonts Module Level 4
This level 4 of the specification on fonts reprises what is defined in level 3. It adds the possibility to define what happens when a font takes a long time to load or is missing. It also adds support for colored fonts and clarifies many points still poorly defined in level 3.
Regardingfont-variant:
No change regarding thefont-variantspecification.July 11, 2017Working Draft.
About fonts, see also...
The CSS Fonts Module specification covers everything related to fonts, typography, making the most of modern font formats, font downloads, and so on.
Properties:






em, ex, etc.








Functions:

At-rules:



Descriptors :

@font-face. Sets the height of the characters above the baseline.

@font-face. Sets the height of the characters below the baseline.

@font-face. Determines how the browser behaves when faced with fonts that take a long time to load.

@font-face. Sets the line spacing of the font.

@font-face. Defines the range of character codes to be downloaded into a font.



