CSS font-size property
Browser support · legacy reference
ChromeFully supports
SafariFully supports
FirefoxFully supports
Internet ExplorerFully supports
EdgeFully supports
OperaFully supports
Description
CSS font-size property specifies the size of font.
Syntax
font-size : medium | xx-small | x-small | small | medium | large | x-large | xx-large | larger | smaller | length | percentage
Property values
x-small
-
It represents a size which is larger than xx-small but less than small.
- Try it
font-size: x-small; x-large
-
It represents size which is smaller than xx-large but larger than large.
- Try it
font-size: x-large; larger
-
It represents font-size larger than the parent element's font-size. For example, if the font-size of parent element is medium then larger represents large font-size for the current element.
- Try it
font-size: larger; smaller
-
It represents smaller font-size than the font-size of parent element. For example, if the font-size of parent element is medium then larger represents small font-size for the current element.
- Try it
font-size: smaller;
Applicable to
It applies to all elements