Sams Teach Yourself HTML 4 in 24 Hours

Sams Teach Yourself HTML 4 in 24 Hours

By Dick Oliver

Background and Text Colors

To specify blue as the background color for a page, put bgcolor="blue" inside the <body> tag. Of course, you can use many colors other than blue. You can choose from the 16 standard Windows colors: black, white, red, green, blue, yellow, magenta, cyan, purple, gray, lime, maroon, navy, olive, silver, and teal. (You can call magenta by the name fuchsia and cyan by the name aqua if you want to feel more artsy and less geeky.)

You can also specify colors for text and links in the <body> tag. For example, in Figure 11.1 you'll notice the following <body> tag:

11fig01.gif

Figure 11.1 You can specify colors for the background, text, and links in the <body> tag of any Web page.

<body bgcolor="teal" text="fuchsia" link="yellow" vlink="lime" alink="red">

As you probably guessed, text="fuchsia" makes the text fuchsia (which is the same as magenta). There are three separate attributes for link colors:

Figures 11.1 and 11.2 illustrate how color can be used in combination with links. Because I used pure, beautiful teal as the background color in the graphics images, they blend right into the background of the Web page. (I didn't need to use transparent images, which you'll learn about later in this hour.)

11fig02.jpg

Figure 11.2 On a color screen, this ever-so-attractive page has a teal background, fuchsia body text, and yellow link text, as specified in Figure 11.1.

Share ThisShare This

Informit Network