This page is In Progress

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

Font related properties

Summary

Sets font-style, font-variant, font-weight, font-size/line-height, font-family properties in one declaration.

The order is obligatory, not all options must be set.

font-size and font-family are required options.

Properties

No properties.

Methods

No methods.

Events

No events.

Usage

 p {
 font: italic 1.2em/1.5 Georgia;
 }

 div {
 font: italic small-caps 1.2em/14px "Times New Roman";
 }

 em { font: bold 1.2em/2ex Arial; }

In this section

PropertyDescription
fontSets or retrieves a combination of separate font properties of the object. Alternatively, sets or retrieves one or more of six user-preference fonts.Sets or retrieves a combination of separate font properties of the object. Alternatively, sets or retrieves one or more of six user-preference fonts.
font-familySets or retrieves the name of the font used for text in the object.
font-feature-settingsGets or sets one or more values that specify glyph substitution and positioning in fonts that include OpenType layout features.
font-sizeSets or retrieves a value that indicates the font size used for text in the object.
font-size-adjustSets or retrieves a value that specifies an aspect value for an element that will effectively preserve the x-height of the first choice font, whether it is substituted or not.
font-stretchSets or retrieves a value that indicates a normal, condensed, or expanded face of a font family.
font-styleSets or retrieves the font style of the object as italic, normal, or oblique.
font-variantGets or sets whether the text of the object is in small capital letters.
font-weightGets of sets the weight of the font of the object.

See also

Related articles

Fonts

Attributions