How to Set a Background Color in HTML

By eHow Internet Editor

Rate: (3 Ratings)

Setting the background color in HTML is not done through its own tag. Instead, it's done by setting an attribute in another tag, such as the body tag or a table or row tag. Color adds great appeal and readability (or sometimes unreadability!) to a website, so use it wisely.

Instructions

Difficulty: Moderately Easy

Things You’ll Need:

  • HTML or text file editor

Set the Background Color

Step1
Open your text or HTML editing software and click wherever you want to set the background color. You must be just inside the already existing body, table, table row or table column tag of the element whose color you want to set. In the following example, you would click just after the word "table":
Step2
Type the following:
Step3
Ensure that the line now looks like this:
Step4
Remember that at the end of the table, you'll need a closing tag:

Tips & Warnings

  • Hexadecimal codes can be used to come up with 216 different colors, but its easier for most people to use the reserved keywords to define colors, such as "red" and "blue."
  • Overly bright colors can cause headaches, and backgrounds too similar to text colors can make your content impossible to read.

Post a Comment

POST A COMMENT

Request a New How-To Article

Looking for more How To information? Chances are there’s an eHow member who knows how to do what you’re looking to do. Submit an article request now!

eHow Article: How to Set a Background Color in HTML

eHow Internet Editor

eHow Internet Editor

Category: Internet

Articles: See my other articles

Related Ads

Internet

Veesites
Meet Virginia DeBolt eHow’s Internet Expert.