• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Chapter 11. Working with the BODY Elemen... > Managing Color for Backgrounds, Text...

Managing Color for Backgrounds, Text, and Links

There are a number of specific attributes that should be added to the <BODY> tag to assist the browser in managing backgrounds, text, and link colors. Values for these attributes are either color names or hexadecimal codes, as described after the following attribute list:

  • text="x"— This attribute tells the browser what color your default body text will be.

  • link="x"— Without this attribute, browsers will usually use blue as a default link color, unless the user has configured another default link color into his or her browser. To maintain the integrity of your design, you should always use this attribute and set it to a value in step with your site palette—even if the color is blue.

  • vlink="x"— This is the visited link. As with the link attribute, if you don't set this with a value, the browser will look for a default (usually purple), or a user-defined setting. For the same reasons as mentioned for using the link="x", you should include an appropriate visited link color in your BODY string.

  • alink="x"— Active link. This is a color that appears when the link is made active— when a mouse clicks it or passes over the link, depending on the browser you're using.

  • bgcolor="x"— This sets the color that will fill your background. Browsers used to default to a very ugly gray, but now they usually default to white. Users can set this, too, so you always want to define it—even if you choose to use a background graphic (more on this in a bit).

  • background="url"— Only use this attribute when you want to include a background graphic on your page.



Not a subscriber?

Start A Free Trial

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint