Reawen's HTML Help
~Background~

As background for your webpage, you can choose a solid color or use a picture or pattern (there is a picture behind this page). If you use a picture/pattern, it is a good idea to also set a background color as close to that of the picture as possible. Sometimes background pictures take awhile to load up and until then you are stuck with a white background. Depending on your font colors, you may not be able to read the page very well until the background picture loads up. For instance, if you set a background for a "space-related" webpage, you might want to have a background that's black with stars on it. If your font color was white, or light yellow, it might show up very well on the dark background. But before the background loaded up, there would be only white behind it, and the font would not show up. If you set a background color, however, it will provide a backdrop for your page until the background picture loads. In this instant, you would probably want to set your background color as black, since it is closest to the picture color.

Setting the background is part of the <body> tag. For color you use bgcolor=" " and for a picture you use background=" ". These "attributes" go after the word <body, but before the closing > bracket, like this:

<body bgcolor="#000000" background="startile.gif">


Notice you do not separate the <body and bgcolor=" " and background=" " words with commas or anything. Just leave a space between the tag (<body) and the attributes (bgcolor=" " and background=" ").

To set a background color, you use the "hexidecimal color code." I don't want to take the space here to explain colors, so if you want to learn, go to the "Colors" section of the main HTML for Beginners page.
To set a background picture, you need to have the file name, and you need to "upload" the file you want to use into the file manager. You do this like you upload anything else: you go to the "EZ Upload" section of the GeoCities file manager, select the file in the box (use the browse button to find it), and pick "upload files." Remember when you put the name of the file in your code (EX: <body background="startile.gif">), you must have the file type extension. This means the ".gif" or ".jpg" or whatever your file is. In other words, you can't have this:

<body bgcolor="#000000" background="startile">
Instead you have to have this:
<body bgcolor="#000000" background="startile.gif">


Also, if you have the picture file in a subdirectory in Geocities, remember to include that in your file path.

EXAMPLE: this is how I set the background for this page:
<body bgcolor="#EECBAD" background="Backgrounds/paper.gif">

The picture I used for background was called "paper.gif" and was in the Backgrounds subdirectory. As you can see, I set a background color (bgcolor=" ") also. This color is "PeachPuff2" and has the hexidecimal color code #EECBAD. I chose this color because it was very close to the color of my background picture. (Remember, to learn about colors, go to the "Colors" section on back on my main HTML for beginners page. There is a link there to a page where the colors are shown with their codes. At this page you can see what the colors look like and decide which is closest to your picture.)


Back to Reawen's "HTML for Beginners"

1