Changing a link-style, only for a certain class
- by abelenky
I want to change the link-style for some of my links, like this:
a:hover
{
/* These links will be blue when hovered-over */
background-color: #3366FF;
}
However, I only want this to take effect in my Navigation Bar, and not for regular links.
I have tried variations on this:
#navbar a:hover
{
/* These links will be blue when hovered-over */
background-color: #3366FF;
}
With the intended meaning "this only applies to links with <div id="navbar">"
But it didn't work.
How can I set the style for only certain links, defined by the class or id of their container?