CSS2 » Properties » font-size

Version: Level 1

Compability: IE4+  N4+

Syntax:
font-size : absolute-size | relative-size | length | percentage
percentage
The percentage value is the percent amount you wish to increase or decrease the font size. Values less than 100% reduce the size of the font. 100% gives no change. Values greater than 100% increase the font size.
length
The length value can be in any of the following seven units. Use the abbreviation.
 
Length Abbrev.
centimeters cm
ems em
inches in
millimeters mm
picas pc
pixels px
points pt
relative-size
There are two relative-size values to choose from:
larger
smaller
 
The amount of change will be determined by the individual computer/browser.
absolute-size
There are seven steps in the absolute-size values to choose from:
xx-small
x-small
small
medium
large
x-large
xx-large
 
The amount of change caused by each step will be determined by the individual computer/browser.

The font-size property allows you to change the size of the font (i.e., characters in a text) by selecting from four different categories of values. The amount of change in size is a relative, not fixed, quantity that is determined by your individual computer and/or browser. This property is inherited.

Examples

Code:
p { font-size:  x-large; }
p { font-size:  smaller; }
p { font-size:  18pt; }
p { font-size:  3em; }
p { font-size:  75%; }
p { font-size:  150%; }
Language(s): CSS2
Code:
<span style="font-size: xx-small;">A </span>
<span style="font-size: x-small;">A </span>
<span style="font-size: small;">A </span>
<span style="font-size: medium;">A </span>
<span style="font-size: large;">A </span>
<span style="font-size: x-large;">A </span>
<span style="font-size: xx-large;">A </span>
Output:
A A A A A A A
Language(s): CSS2

See Also: