CSS: font-size

By Xah Lee. Date: . Last updated: .

font-size property lets you specify font size.

Its value can be any css length unit or percentage.

[see CSS: Units]


value can also be one of the following:

These are absolute sizes. Their sizes do not change depending on any other element's font size.

Here's what your browser shows (none of these element's parents have font size changed.):

[xx-large] [200%] [2rem]

[x-large] [150%] [1.5rem]

[large] [110%] [1.1rem]

[medium] [100%] [1rem]

[small] [80%] [0.8rem]

[x-small] [60%] [0.6rem]

[xx-small] [55%] [0.55rem]

As of , {Firefox, Google Chrome, Opera, IE10} basically all agree on these sizes. The x-small and xx-small may differ by 2% or so; the difference can be seen only when the page is magnified at 200%.

[see CSS: Units]

CSS Font

  1. font-family
  2. Standard Web Fonts
  3. Google Webfont
  4. font-size
  5. Meaning of Font Size
  6. Font Weight
  7. Chinese serif and sans-selif Font Names
Liket it? I spend 2 years writing this tutorial. Help me spread it. Tell your friends. Or, Put $5 at patreon.

Or, Buy JavaScript in Depth


Web Dev Tutorials

  1. HTML
  2. Visual CSS
  3. JS in Depth
  4. JS Object Ref
  5. DOM Scripting
  6. SVG
  7. Blog