Reputation: 1579
I'm trying to create a hover link using css but it's not working. Is this the correct way to create css hover links? Thanks,
I have read though this but no luck: http://w3schools.com/css/css_link.asp
Here is the code I have:
CSS
.Footerbullets{
padding:3px 0 3px 25px;
background-image:url(../images/menubar/footer_bullet.jpg);
background-repeat:no-repeat;
}
.Footerbullets a.link {
color:#FFF;
}
.Footerbullets a.hover {
color:#FF0;
}
HTML
<div id="footer"><div class="content">
<ul>
<li class="Footerbullets"><a href="#">Link with Hover Color Change</a></li>
</ul>
<div class="clear"></div>
</div></div>
Upvotes: 0
Views: 236
Reputation: 4539
Try this
.Footerbullets a:hover {
color:#FF0 !important;
}
My code
<style>
.Footerbullets{
padding:3px 0 3px 25px;
background-image:url(../images/menubar/footer_bullet.jpg);
background-repeat:no-repeat;
}
.Footerbullets a.link {
color:#FFF;
}
.Footerbullets a:hover {
color:#FF0;
}
</style>
HTML
<div id="footer"><div class="content">
<ul>
<li class="Footerbullets"><a href="#">Link with Hover Color Change</a></li>
</ul>
<div class="clear"></div>
</div></div>
Upvotes: 0
Reputation: 9722
Use div#footer ul li.Footerbullets a:hover
instead of .Footerbullets a:hover
, it seems that div#footer ul li a:hover
is overriding other styles.
Upvotes: 1
Reputation: 2278
I made a jsfiddle with a working example for each anchor pseudo-class. I tested it and it works in the latest version of Safari at least. You can find it here:
http://jsfiddle.net/kylewlacy/DqePq/
You can read about each pseudo-class and what they do here, as well
Upvotes: 0