CSS Font-Size Property

CSS 1

CSS 2

CSS 3

Yes Yes Yes

Description

Sets the size of the font within an element.

Syntax

font-size: [value];

Possible values

  • xx-small
  • x-small
  • small
  • medium
  • large
  • x-large
  • xx-large
  • larger
  • smaller
  • [length]
  • [percentage]
  • inherit

Initial Value

Medium

Applies To

All elements

Inherited

Yes (the computed value)

Media

Visual

Example

h6 {font-size: xx-small;}

p {font-size: .9em;}


View All CSS Properties