Property font-size

Specifies the font size of text

Syntax

/* values */ font-size: xx-small; font-size: x-small; font-size: small; font-size: medium; font-size: large; font-size: x-large; font-size: xx-large; font-size: xxx-large;

/* values */ font-size: smaller; font-size: larger;

/* values */ font-size: 12px; font-size: 0.8em;

/* values */ font-size: 80%;

/* math value */ font-size: math;

/* Global values */ font-size: inherit; font-size: initial; font-size: revert; font-size: revert-layer; font-size: unset;

Values

xx-small, x-small, small, medium, large, x-large, xx-large, xxx-large
Absolute-size keywords, based on the user’s default font size (which is medium).

larger, smaller
Relative-size keywords. 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.

A positive 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 (root) element. A positive value, relative to the parent element's font size.

math
Scaling rules are applied when determining the computed value of the font-size property for math elements relative to the font-size of the containing parent. See the math-depth property for more information.

Example

.small { font-size: xx-small; } .larger { font-size: larger; } .point { font-size: 24pt; } .percent { font-size: 200%; }