CSS_and_the_Link_Tag

The content in this section is a little bit like the classes section for use in making various flavors of the tag (or any other tag, for that matter).

However, the  tag has a few special "pseudo classes" to it, and the punctuation for these psuedo classes is slightly different than for regular classes.

These special  classes are: (Notice the colons are used here, rather than a period, as other classes would use.)
 * a:link
 * a:visited
 * a:hover
 * a:active

These classes have special meanings. The "link" pseudo class is what a normal link looks like, if the user has not been to that location lately (i.e. if that location is not in the browser's history file.) Typically, changes to the link pseudo class will trickle down to the other classes, unless specified otherwise in those classes. Typically, a plain "link" looks like blue text with an underline. The "visited" pseudo class is what a link looks like if the user //has// been to that url before (if the url is in the browser's history file). By default, this is purple, underlined text. Sometimes, we may want to switch all of our visited tags to go back to unvisited tags in a browser, so we can see what they look like. To do this, we need to clear that browser's history. The "hover" pseudo class is what a link looks like if the mouse is touching it, but we haven't pressed the mouse button. By default, this does nothing in particular - the link should look exactly the same. The "active" pseudo class is what a link looks like if the mouse is touching it, and we do press the mouse button, but we haven't released the mouse button yet. By default, this is red text, with an underline.

So here's an example of what this would look like: code format="html4strict"  a:link {background-color:#ffff88; color: #444444;} a:visited {background-color:#bbbb44;} a:hover{color: #000000;} a:active{background-color:#ff8844;} code The differences may be subtle, but if you try this in your own code, you should see a difference in the background color between web sites you have visited and those you have not. If you hover over a link, the text will switch from dark gray to black, and clicking a link will temporarily turn the background color orange.

Note 1: Some browsers, particularly older browsers did not follow the "hover" and "active" pseudo classes, and they were ignored by the browser. So don't put anything too critical there.

Note 2: Later, we will learn about "Rollovers," another way of acknowledging clicks, mouseovers, and the like only with graphics, instead of just text.