Exit tutorial


HTML Tutorial
Web Design - Stage 2: Using a Background Color
Add Or Change The Background Color

If you want to use a background color on your page, you will need to begin by finding the <BODY> tag. Once you have found the tag, look for a command after the word BODY that says bgcolor="color" . It may look like this:

<BODY bgcolor="gray">

Or the tag may have more commands inside and use hex codes, like this:

<BODY text="#000000" link="#A6CAF0" bgcolor="#808080">

And of course, the command may not be there at all. If this is the case, add it by placing a space after the word BODY and then type the command, like this:

<BODY bgcolor="gray" text="#000000" link="#A6CAF0">

Or if you don't have any other commands, just add it in like this:

<BODY bgcolor="gray">

To change the background color, replace the word gray inside the quote marks with a color name or a color hex code. For a list of some common color names and hex codes, click here.

So, if you wanted to change the background color to green, you would type:

<BODY bgcolor="green">

Or you could use the hex code for green:

<BODY bgcolor="#008000">

After doing this, your page will have a green background. Beautiful! Now just use any color you like in the command, and add color your pages!

[Back to the Stage 2 Index]