Until CSS, the most common use of color in Web browsers (other than in images) was to draw attention to hyperlinks. Some browsers use two colors: one for links that the user has traversed before and another for links that he hasn't tried yet. Others use a third color for an "active" link; that is, for the short duration while the user keeps the mouse button pressed over the text. In CSS, rules for these can be written through a pseudo-class on an A element, as follows: A:link { color: blue } /* unvisited links */ A:visited { color: red } /* visited links */ A:active { color: yellow } /* active links */ For more information on pseudo-classes, see Chapter 4, "CSS selectors." |