Setting the Font Size

There are two basic ways to set the font size for the text in your Web page. You can mandate that a specific size be used or you can have the size depend on the element’s parent.

Figure 10.14. Here I use pixel values to have control over the initial size of the text (which I’ve decreased in size throughout, compared with most browsers’ defaults).

To mandate a specific font size:

Type font-size:.
Type an exact size: say, 16px or 1em. Or use a keyword to specify the size: xx-small, x-small, small, medium, large, x-large, or xx-large.
Figure 10.15. The sizes I’ve specified are displayed in the browser. Internet ...

Get HTML, XHTML, & CSS, Sixth Edition: Visual QuickStart Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.