The Wayback Machine - https://web.archive.org/web/20090207063612/http://www.webreference.com:80/html/tutorial23/2.html


spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / html / tutorials / 23 / 2

index1234

Tutorial 23: The Font of Foulness, Part II: Many Faces, Many Colors

Developer News
Open Source ECM Growing Up
Android's Second Act, G2 Rumors Heat Up
Eclipse Rolls Out PHP Development Tools 2.0

The text color attributes to BODY

A long time ago (See, I can use that phrase without making a Star Wars reference! Oops. There I go again.) in Tutorial 1 we introduced the BODY element as the structural part of every HTML document that actually holds the document. Back in the time when the Campaign for Diseased Lilac-Colored Pages convinced Netscape to implement color in HTML, they decided to implement color as a bunch of attributes to the BODY element.

These attributes were called BGCOLOR, TEXT, LINK, VLINK and ALINK, and they eventually made their way into HTML 3.2 and HTML 4.0 Transitional. Their values are colors specified in the same hexadecimal format as the COLOR attribute to the FONT element. BGCOLOR specifies the background color for the entire document. TEXT specifies the color of the text for the entire document, and LINK, VLINK and ALINK specify the colors of text used in unvisited, visited or active links.

If you've been paying attention and remember Tutorial 5, you'll probably have figured out how these last three attributes bear a striking resemblance to the link, visited and active pseudoclasses. If we apply this knowledge to our problem of replacing these attributes with CSS, we can quickly see what we can replace the following BODY start-tag with:

<BODY
 BGCOLOR="#000000"
 TEXT="#FFFFFF"
 LINK="#0000FF"
 VLINK="#000088"
 ALINK="#FF0000"
>

Specifically, we can replace it with the following CSS ruleset, or something similar:

BODY {
 background-color: #000000;
 color: #FFFFFF;
}
A:link { color: #0000FF; }
A:visited { color: #000088; }
A:active { color: #FF0000; }

index1234

http://www.internet.com/

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

Copyright 2008 Jupitermedia Corporation All Rights Reserved.

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

webref The latest from WebReference.com Browse >
Building a Client-Side Ajax Cache · Using Dojo for Client-Side Validation · Apache Basics, Visited
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Research Points to Slow Rate of SSD Transition · Box.Net Unwraps Social Network Features · How-To Guide: E-Commerce Marketing on Facebook

Legal Notices.

URL: http://www.webreference.com/html/tutorial23/2.html

Produced by Stephanos Piperoglou
Created: June 29, 2000
Revised: June 29, 2000

Morty Proxy This is a proxified and sanitized view of the page, visit original site.