Changing the background on your Web page


Putting a background color on your page

You can control the background color of your web page.

To specify the color, you must know the color's hexidecimal RGB (red, green, blue) value. If you can find the color's RGB number, you can convert it to hexidecimal using this handy convertor. There is also a Web page of popular color numbers to get you started.

In this example, the color OOFFFF is blue. You must specify the color number in the body tag like this:

     <body bgcolor=#OOFFFF>
Click here to this page with the color in the background

Putting a background image on your page

You can also put a backgournd image on your page by specifying the image name in the body tag. The image will be tiled to fit the page. You can get some ideas for backgrounds by looking at other pages on the Web or by looking at collections of images such as Netscape's Background Sampler.

The tag for specifying a background uses the background= attribute with the path or URL to the image. If you create your own image and have it in the directory with the html file, you can just specify the image name.

     <body background="metal.gif">
Click here to see this page with the background


Return to the Advanced HTML tutorial