Sams Teach Yourself HTML 4 in 24 Hours

Sams Teach Yourself HTML 4 in 24 Hours

By Dick Oliver

Font Size and Color

The <big>, <small>, and <tt> tags give you some rudimentary control over the size and appearance of the text on your pages. Generally, you should try sticking to those tags until you are ready for the advanced font formatting controls discussed in Hour 16.

However, there may be times when you'd just like a bit more control over the size and appearance of your text while maintaining as much compatibility with older Web browsers as possible. For those times, you can use the officially discouraged but widely used <font> tag.

For example, the following HTML will change the size and color of some text on a page:

<font size=5 color="purple">this text will be big and purple.</font>

The size attribute can take any value from 1 (tiny) to 7 (fairly big), with 3 being the default size. (If you need VERY big fonts, you'll need to use style sheets as explained in Hour 16.)

The color attribute can take any of the following standard color names: black, white, red, green, blue, yellow, aqua, fuchsia, gray, lime, maroon, purple, navy, olive, silver, or teal.

The actual size and exact color of the font depend on each reader's screen resolution and preference settings, but you can be assured that size=6 is a lot bigger than size=2 and that color="red" certainly shows its fire.

You learn more about controlling the color of the text on your pages in Hour 11, "Custom Backgrounds and Colors." That hour also shows you how to create your own custom colors and control the color of text links.

Share ThisShare This

Informit Network