Homepage Exercise: Finding Things

Let's add some color to our homepage to jazz it up a little. First we'll examine the HTML code that lets us do that, and then we'll try our skills at finding things on the web to learn how to get the colors we want.

The "Body" HTML Tag

If you open your homepage file with the editor you will find near the top an HTML "body tag" that has the following form

 
   <BODY BGCOLOR="#ffffe0" TEXT="#ff0000"  
     LINK="#00ffff" VLINK="#00ffff" ALINK="#FF0000"> 

This tag controls some colors when a page is displayed by a Web Browser, according to the identifications in the following diagram (remember that in HTML the tags are generally not case sensitive; e.g., "BODY" and "body" are equivalent).

In this tag, bgcolor sets the color of the page background, text sets the default color for text on the page (it can be overriden for portions of text), link sets the color of unvisited links (ones you haven't clicked on yet), vlink sets the color of visited links, and alink sets the color that the link turns while the mouse button is being held down.

Thus, for example, the statement text="#000000" in the diagram sets the standard text color to black, while text="#ff0000" in section of code listing from the homepage file sets the standard text color to red. Now obviously there is some kind of "secret code" being used here: how do I know that #ff0000 means to set the browser text color to red?

Hex Numbers and Color

Well, # indicates that this is a color and the next six characters (ff0000) are in the form xxyyzz, where xx is the amount of red, yy is the amount of green, and zz is the amount of blue mixed to form the text color, with each of these pairs (e.g., ff) a number in the base-16 or hexadecimal number system - the "hex system", to those in the know.

Whew! I'm sure you are looking forward to learning about that! If humans had 16 fingers and 16 toes instead of the standard 10 for each, we probably would know the base-16 system by heart, but it is unlikely that many of you use hexadecimal numbers on a regular basis. Is there a way to bypass studying the base-16 number system, at least for now. After all, we just want to change some colors on our homepage!

You should learn something about the base-16 system because it is so common in computers, and because it is fun to see how numbers in other bases work, but we will save that for another time. For now we are going to illustrate that we can learn how to change colors on our homepages without learning how to do base-16 numbers in our head.

Color Resources on the Web

Your assignment is to modify the colors on your default homepage to something more to your liking. Since the Web has about everything, it must have a table of colors with the associated hex code for the color. Then we could find some colors that we liked from the table and just copy the corresponding hex code into the body tag in our homepage.

Such resources are out there on the Net. We can use search engines to find them. Pick one of the search engines, type in words or a phrase such as "hex code" and see if you can find a hex table of colors.

The results page should have many links. Find a hex table there that will help you select colors for your homepage. Select some new colors to customize your homepage by changing the colors in the "body" tag.

Close Window