| Syntax | selector {font-size: value;}
|
|---|---|
| Usage | The font-size property is used to specify the size of a font. This property is specified by using a length, percentage, or keyword, according to the syntax shown above. Font sizes cannot be negative. If a percentage value is used, the value will be a percentage of the inherited font size. If a length value is used, the em and ex length values will be relative to the element's parent font-size property. CSS Example: The font-size properties are set using a length, percentage, and numerous keywords. #tst1 {font-size: smaller;}
#tst2 {font-size: larger;}
#tst3 {font-size: 150%;}
#tst4 {font-size: 20px;}
#tst5 {font-size: xx-small;}
#tst6 {font-size: x-small;}
#tst7 {font-size: small;}
#tst8 {font-size: medium;}
#tst9 {font-size: large;}
#tst10 {font-size: x-large;}
#tst11 {font-size: xx-large;}![]() ![]() ![]() |
| Keywords |
|
| Applies To | All elements |
| Inherited | Yes |
| Initial Value | medium |
![]() ![]() The font-size properties are set using a length, percentage, and numerous keywords. |