font-size

The font-size CSS property sets the size of the font. Changing the font size also updates the sizes of the font size-relative units, such as em, ex, and so forth.

Example

Initial value medium
Applies to all elements. It also applies to ::first-letter and ::first-line.

Syntax

  
font-size: 1.2em;
  

Values

Absolute-size keywords, based on the user's default font size (which is medium).
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.

Browser support

font-size11215.571
rem_values31123111287
xxx-large797970

We use cookies to improve your experience. Learn more in our Privacy policy.

×