Specifying a Font Size and Color
There are many ways to set the font size in HTML, but all the methods use one of two strategies: either specify an absolute size or specify a size in relation to the parent tag.
To specify an absolute size, you use a number followed by a unit of measurement. The most common unit of measurement for Web pages is px, which stands for pixels. (An average size for text is 10px.) Pixels are the native unit of measurement for computer monitor display modes. HTML also accepts inches (in), centimeters (cm), millimeters (mm), points (pt), and picas (pc), but those units are most appropriate when working with a page that is designed to be printed.
The size of a pixel depends on the display resolution of the monitor. For example, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access