font-size Description:
The font-size property defines the size of the font.
font-size in CSS Versions:
font-size Syntax:
font-size: <absolute-size> | <relative-size> | <length> | <percentage> | inherit
- absolute-size
This is referencing a table of font sizes computed by the user-agent. Possible values are:- xx-small
- x-small
- small
- medium
- large
- x-large
- xx-large
- relative-size
This is a keyword referencing a relative size relative to the parent font's size. - length
A numerical value. - percentage
This is a percentage based on the parent font's size. - inherit
The element should have the same font-size setting as the parent.
font-size Initial Value:
medium
font-size Applies To:
All elements.
font-size Inheritance:
This property is inherited.
font-size Browser Support:
font-size Examples:
absolute size
<p style="font-size : x-large;">relative size
This paragraph is extra large.
</p>
<p style="font-size : smaller;">
This paragraph is smaller than the base font size.
</p>
length
<p style="font-size : 1.5em;">
This paragraph is 1.5 ems.
</p>
font-size Special Notes
- Negative values are not allowed.
- If you use exact units for your font size (such as 5px or 15pt), do not leave any whitespace between the number and the unit. Otherwise, some browsers may completely disregard the style call.

