I want to create a simple hover effect, I have a gray facebook, twitter and youtube image and when it gets hover i want to get the original color from the social media, that's all I want.
This is my html.
<div class="social-top">
<ul>
<li><a href=""><img src="images/social/fb.png"></a></li>
<li><a href=""><img src="images/social/twitter.png"></a></li>
<li><a href=""><img src="images/social/yt.png"></a></li>
</ul>
</div>
This is my css.
.social-top {
width: 150px;
padding-left: 650px;
}
.social-top li {
display: inline-block;
width: 40px;
}
.social-top a {
display: block;
overflow: hidden;
height: 30px;
position: absolute;
}
.social-top a:hover {
top: 30px;
}
And here's a website that has the effect I want:
Regards.
This is how you do it. You can place a transparent PNG in here for your links, instead of the text, if you want. Or you can check out using some font icon libraries, that use text to create a social media icon for you. For example, check out Fontello. http://fontello.com/
Here is the code I wrote for your effect:
<div class="social-top">
<ul>
<li class="facebook"><a href="#self">F</a></li>
<li class="twitter"><a href="#self">T</a></li>
<li class="youtube"><a href="#self">YT</a></li>
</ul>
</div>
.social-top {
float: right;
}
.social-top li {
display: inline-block;
width: 40px;
height: 40px;
background-color: #ccc;
border-radius: 150px;
}
.social-top li.facebook:hover {
background-color: #006;
}
.social-top li.twitter:hover {
background-color: #060;
}
.social-top li.youtube:hover {
background-color: #600;
}
.social-top li:hover a {
color: #fff;
}
.social-top a {
display: block;
line-height: 40px;
text-align: center;
width: 100%;
height: 100%;
}
Here's the link to js fiddle: http://jsfiddle.net/eNU8H/