O'Reilly logo

Cascading Style Sheets (CSS) by Example by Steve Callihan

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

Setting Font Sizes

In straight HTML, the deprecated FONT element is also used to set font sizes. It enables you to set only seven different font sizes, of which only four (sizes 4, 5, 6, and 7) correspond to font sizes that are larger than the normal font size. By using CSS styles, however, you can set an unlimited range of font sizes.

You've already had some experience setting font sizes earlier in this book. To illustrate how large you can go when setting font sizes using CSS, here's an example that sets the H1 element's font size to 10 ems, or ten times the font size of the H1 element's parent element (see Figure 7.1):

<style type="text/css">
h1 { font-size: 10em; color: rgb(200,140,40); }
</style>
Figure 7.1. Using CSS, you can select as ...

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