HTML and CSS Reference
In-Depth Information
Controls the color of link text for links that the user has not
already clicked on.
Controls the color of links that the user has already visited.
Controls the color of a link while the user is clicking on it. When
the user clicks on a link, it changes to this color. When he
releases the mouse button, it switches back.
Like the bgcolor attribute, these attributes have been dropped from HTML5. You may still
see them in older pages, but you should use CSS when you're creating your own pages.
Remember the haunted house image that you inserted on a page earlier? The page would
be decidedly spookier with a black background, and orange text would be so much more
appropriate for the holiday. To create a page with a black background, orange text, and
deep red unvisited links, you might use the following <body> tag:
< body bgcolor = “#000000” text = “#ff9933” link = “#800000” >
Using the following color names for the background and unfollowed links would pro-
duce the same effect:
< body bgcolor = “orange” text = “black” link = “#800000” >
Both these links would produce a page that looks something like the one shown in
Figure 9.18.
Background and
text colors.
The same effect can be achieved using the background-color and color properties in
CSS. Here's the <body> tag that specifies the color using CSS:
<body style=”background-color: #000000; color: #ff9933”>
Search WWH ::

Custom Search