You can set the colors of hyperlinks using these pseudo-classes :
A pseudo-class works something like a class; you set it up in a <STYLE> element. To set the color of visited hyperlinks to purple, for example, you assign the color property of the A:visited to "purple" . Tip Note in particular the hover pseudo-class, which enables you to set the color of a hyperlink as the cursor moves over it without any additional programming. Here's an example. In this case, I'm setting the color of hyperlinks to green, visited links to yellow, links with the cursor over them to red, and active links (as they're being clicked) to blue: (Listing 21-08.html on the web site)<HTML> <HEAD> <TITLE>Setting Hyperlink Colors</TITLE> <STYLE type="text/css"> A:link {color: green} A:visited {color: yellow} A:hover {color: red} A:active {color: blue} </STYLE> </HEAD> <BODY> <H1> Setting Hyperlink Colors </H1> Here's a link: <A HREF="http://www.w3c.org">W3C</A>. </BODY> </HTML> |