How to Create the Hover Effect Only for Certain Links
If you only want certain links to exhibit the mouseover highlighting effect, you can do it by applying those effects to certain classes.
- Code:
-
a.specialeffects:hover {
color: black ;
background-color: #ff0 ;
}
The above code will cause links of the class "specialeffects" to have black text against a yellow background when the mouse is over it. To use it make your links like the following:
- Code:
-
<a class="specialeffects">this link will turn yellow</a>
That is, give links that you want the highlighting effect the "specialeffects" class.
You can of course name your classes anything you want, and not just "specialeffects". Whatever name you choose, make sure the name you use in your HTML link matches that in your CSS rules.