aiden87
aiden87

Reputation: 969

How to set color on mouse hover - css

I have social bar on my website which indcludes facebook, twitter, google+ and rss.

It looks like this

enter image description here

On mouse hover, i want the circle around image to change color to blue. Somehow i always end up failing and the whole background changes to blue.

MY HTML CODE

<div class="social-top-nav">
    <ul>
        <li><a href="#"><img src="images/facebook.png" title="facebook" /></a></li>
        <li><a href="#"><img src="images/twitter.png" title="twitter" /></a></li>
        <li><a href="#"><img src="images/google.png" title="google+" /></a></li>
        <li><a href="#"><img src="images/feed.png" title="rss" /></a></li>
    </ul>
</div>

My CSS code

.social-top-nav{
    float:right;
    margin-top: 11px;
}

.social-top-nav ul li{
    display:inline-block;
}
.social-top-nav ul li a{
    display:block;
}

.social-top-nav ul li a img:hover{
    opacity: 0.8;
    -moz-box-shadow: 0 0 10px #ccc; 
    -webkit-box-shadow: 0 0 10px #ccc; 
    box-shadow: 0 0 10px #ccc; 
}

Can you guys help me fix the code? I'll appreciate any input.

knitevision

enter image description here

Upvotes: 1

Views: 628

Answers (2)

Rod
Rod

Reputation: 804

you can't change the color of the circle (since it's part of the image)

but you can :

1 - add a css border circle (and then change the color):

border: 1px solid #ccc;
border-radius: 50%;

2 - try to replace your images with Font Icons

3 - use webkit-filter (this won't solve your problem, I'm posting just in case)

Upvotes: 2

Haresh Shyara
Haresh Shyara

Reputation: 1886

Try to this css

.social-top-nav:hover {
  color:blue;
 }

Upvotes: 0

Related Questions