If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

CSS: The font-size property

The font-size property specifies the size of the text. It can be specified as a fixed size in various units, a percentage, or as a predefined keyword.
The px unit lets you size font in terms of pixels, which is the unit also used to size images and other elements. The default font-size for body text is typically 12px. There are various keywords that can be used for less precise sizing: xx-small, x-small, small, medium, large, x-large, xx-large.
There are several options for relative sizing: percentage (120%) and em (1.2em) that will size the font relative to the body size. There are also two relative keywords, that will size the font relative to its inherited size: smaller, larger.

Want to join the conversation?

No posts yet.