The font-size property defines the relative or absolute size of the font, given its family name.

The font-size property contains following information:

  1. value: <absolute-size>, <relative-size>, <length>, <percentage> or inherit;
  2. initial: medium;
  3. applies to: all elements;
  4. inherited: yes;
  5. percentages: refers to inherited value;
  6. media: visual;
  7. computed value: absolute length.

The font size corresponds to 'em' square value which is often used in typography.

In <absolute-size> values can be xx-small, x-small, small, medium, large, x-large and xx-large, with the medium value is user preferred (set in browser 'option' menu).

To preserve readability it is suggested to the browsers to avoid sizes that are smaller than 9 pixels per EM unit on a computer display.

Possible values for <relative-size> are larger and smaller while other values are referring to the computed font size of the current element based on the inherited value.

Example

CSS font-size property example:

 

›› go to examples ››