The
a:hover is an extremely useful element to use when it comes to styling your navigational links without using any image or script. But setting
a:hover usually means you will also need to set the rest of the
a selectors as well.
Depending on your browser, after you set a text as a hyperlink, the browser's default hyperlink setting will immediately take over. This means, even if you were to set the text to orange, for example, once it is a hyperlink, it may change to blue with an underscore. You will need to style your
a element (or hyperlink) in your CSS stylesheet to override the browser's default setting. Here's how to style the
a element with different selectors:
- a:link (this specifies your unvisited link)
- a:visited (this specifies your hyperlink once visited)
- a:hover (this specifies your hyperlink when you mouse over it)
- a:active (this styles the link when clicked)
Using the a element and its selectors to style your hyperlinks is a wise way to build your navigational links. This minimizes loading time and permits the web crawler to crawl your page more efficiently. Remember, browsers do not read images; instead, they read image tags and texts. In other words, the more text you place the better. Of course, we must do everything in moderation and good taste. You don't want to bombard your page with too much text either.