O'Reilly logo

Microsoft® HTML5 Step by Step by Faithe Wempen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 10 pixels.) 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 designed to be printed.

The size of a pixel depends on the display resolution of the monitor. For example, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required