When using CSS to define font sizes with the font-size or font style properties you have several options when it comes to font size units:
Relative Font Size Units
This is the default font size set in the users' browser preferences. It refers to the width of the letter m in the font used. Font sizes are determined relative to this initial measure.
This refers to the x-height of a font, or the size of the lowercase x in the font. Font sizes are determined relative to this initial measure.
- pixels (px)
This refers to the number of pixels in the viewing device. Font sizes are determined relative to the viewing device resolution.
Absolute Font Size Units
- inches (in)
- centimeters (cm)
- millimeters (mm)
- points (pt)
In CSS 2, points are equal to 1/72th of an inch.
- picas (pc)
One pica is equal to 12 points.
Other Measurement Units
- absolute sizes
These are font sizes defined and computed by the user agent, there is a recommended scaling of 1.2 between the different sizes. For example, if the medium font is 12pt, then the large font would be 1.2 times larger or 14.4pt. These sizes are completely up to the browser viewing the document and provide very little control to the Web designer.
- relative sizes
These are interpreted relative to the parent element's font size. As with absolute sizes, the user agent controls the actual size of the fonts used.
- percentage (%)
A percentage font size specifies a value in direct relation to the size of the parent element.
Posted in: CSS