Font Size
•
CSS provides a variety of units of measurement that fall into
two broad categories:
–
Relative units: are based on the size of something else, such as the
default text size or the size of the parent element. Examples:
•
•
•
em: a unit of measurement equal to the current font size;
ex: approximately the height of a lowercase “x” in the font;
vw: viewport width unit, equal to 1/100 of the browser window width;
–
Absolute units: have predefined meanings or real-world equivalents.
Examples:
•
•
•
px: pixel, defined as an absolute measurement equal to 1/96 of an inch;
pt: points (1/72 inch);
cm: centimeters;
•
Important: absolute units should be avoided for web page style sheets
because they are not relevant on computer screens.