Tutorial 23: The Font of Foulness, Part II: Many Faces, Many Colors - HTML with Style | 3
Tutorial 23: The Font of Foulness, Part II: Many Faces, Many Colors
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: