Styling Fonts with CSS
[...]
Font Attributes
font-family
-
The font-family attribute indicates which font family will be used to render the text, specified as a prioritized list of font family names and/or generic family names.
font-size
-
The font-size attribute refers to the size of the font from baseline to baseline when multiple lines of text are set solid in a multiline layout environment.
Its values are:
- absolute: Absolute-size keywords, based on the user's default font size (which is
medium
): xx-small, x-small, small, medium, large, x-large, xx-large, xxx-large. - relative: The font will be larger or smaller relative to the parent element's font size, roughly by the ratio used to separate the absolute-size keywords above: larger, smaller
- length: A positive length value. For most font-relative units (such as em and ex), the font size is relative to the parent element's font size. For font-relative units that are root-based (such as rem), the font size is relative to the size of the font used by the <html> (root) element.
- percentage: A positive percentage value, relative to the parent element's font size.
- absolute: Absolute-size keywords, based on the user's default font size (which is
font-size-adjust
-
The font-size-adjust attribute allows authors to specify an aspect value for an element that will preserve the x-height of the first choice font in a substitute font.
font-stretch
-
The font-stretch attribute indicates the desired amount of condensing or expansion in the glyphs used to render the text.
font-style
-
The font-style attribute specifies whether the text is to be rendered using a normal, italic, or oblique face.
font-variant
-
The font-variant attribute indicates whether the text is to be rendered using variations of the font's glyphs.
Usage. Its value may be any number of the following (OR-ed):
normal | none | [ <common-lig-values> || <discretionary-lig-values> || <historical-lig-values> || <contextual-alt-values> || stylistic( <feature-value-name> ) || historical-forms || styleset( <feature-value-name># ) || character-variant( <feature-value-name># ) || swash( <feature-value-name> ) || ornaments( <feature-value-name> ) || annotation( <feature-value-name> ) || [ small-caps | all-small-caps | petite-caps | all-petite-caps | unicase | titling-caps ] || <numeric-figure-values> || <numeric-spacing-values> || <numeric-fraction-values> || ordinal || slashed-zero || <east-asian-variant-values> || <east-asian-width-values> || ruby ]
font-weight
-
The font-weight attribute refers to the boldness or lightness of the glyphs used to render the text, relative to other fonts in the same font family.
Its value may be any of:
normal | bold | bolder | lighter | <number>
.