The font-size property is used in CSS and certain HTML elements. It is used to specify the size of the font.


  • xx-small, x-small, small, medium, large, x-large, xx-large - These are a set of absolute size keywords based on the user's default font size (medium). Similar to the HTML <font></font> element.
  • larger or smaller - Renders font larger or smaller than the parent element's font size, by roughly the ratio used to separate the absolute size keywords mentioned above.
  • A length measurement, such as em, px, or pt - These are units of measurement to be placed after the initial digits wanted. Ex. 12pt.
  • A positive percentage value, such as 2% or 5%.

To apply this in HTML, use:

<span style="font-size:xx-small;">XX-small font.</span>

Which will produce: XX-small font.

This is text using the larger value: Larger font.

This is text using the smallervalue: Smaller font.

This is text using a 14pt measurement: 14pt font.

This is text using a 12em measurement: 12em font.

This is text using a 10px measurement: 10px font.

This is text using an 8% measurement: 8% font.

To apply this in CSS, in the h1 element for example, use:

h1 {