The default style in most browsers for a link can be described as follows:
- Code:
-
a:link {
color: blue ;
background-color: transparent ;
text-decoration: underline ;
}
The a:link portion basically indicates that the block following, enclosed in the curly brackets, is to be applied to links. Each line in the block gives a rule. The line beginning color tells the browser that the anchor text of the link is to be blue. The "transparent" value given to background-color means that whatever was in the background will be visible underneath the link text (including its existing colour). The text-decoration value of "underline" causes the browser to render the text with an underline.
To style the link when the mouse is hovering over it, simply add rules for a:hover. Take the following for example.
- Code:
-
a:hover {
color: black ;
background-color: #def ;
}