CSS font-size property
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
mediumDefault
-
It represents medium sized font.
font-size: medium;
xx-small
-
It represents smallest size of font.
font-size: xx-small;
x-small
-
It represents a size which is larger than xx-small but less than small.
font-size: x-small;
small
-
It represents small size of font.
font-size: small;
large
-
It represents large of font.
font-size: large;
x-large
-
It represents size which is smaller than xx-large but larger than large.
font-size: x-large;
xx-large
-
It represents a size which is greater than x-large.
font-size: xx-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.
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.
font-size: smaller;
length
-
represents font-size in some unit.
font-size: 22px;
percentage
-
represents font-size in percentage.
font-size: 150%;
Applicable to
It applies to all elements
From web4college, the free CSS digger
#CSS digger
Was this article helpful?