Monday, November 11, 2013

Mini Social Media Icons With Image Sprites For Blogger

Mini Social Media Icons
Today, I've got a  beautiful collection of small social media icons. These icons are made using pure CSS and do a charming bottom-to-up animation when hovered on. Also, just as labnol-style social icons, these icons are created using image sprites instead of individual images. Hence, they won't slow your page down :)

Live Demo:






Talk is cheap, show me the code!

Here's the code, paste it wherever you want these awesome icons to appear:

<style>
ul.spicesocialwidget li {float: left;list-style: none outside none;border:none;}
ul.spicesocialwidget li a{background-color:transparent;background-image:url('https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhX2Jn3HM-a4g1OPqkghlvyKfeQC0rN0NkUisCHtrr6Sec1k849jaGv8JI2wJAQU7QkZBpqwmJm0edU5JUY4yElj4jVAQwyQNf3vVeAEUYByTPEleoo6OIBLAzAJt8GSSQRqedi7S7YRvA/s924/mini-social-icons.png');background-repeat:no-repeat;background-size:auto 96px;border:0 none;color:white;direction:ltr;display:block; height:32px;overflow:hidden;text-align:left;text-decoration:none;text-indent:-999em;transition:all 0.2s ease 0s;width:32px}
.ie7 ul.spicesocialwidget li a, .ie8 ul.spicesocialwidget li a{background-image:url('https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhX2Jn3HM-a4g1OPqkghlvyKfeQC0rN0NkUisCHtrr6Sec1k849jaGv8JI2wJAQU7QkZBpqwmJm0edU5JUY4yElj4jVAQwyQNf3vVeAEUYByTPEleoo6OIBLAzAJt8GSSQRqedi7S7YRvA/s924/mini-social-icons.png' )}
ul.spicesocialwidget li.facebook a{ background-position:0 0}
ul.spicesocialwidget li.googleplus a{ background-position:-96px 0}
ul.spicesocialwidget li.rss a{ background-position:-192px 0}
ul.spicesocialwidget li.twitter a{ background-position:-256px 0}
ul.spicesocialwidget li.youtube a{ background-position:-320px 0}
ul.spicesocialwidget li.facebook a:hover, #sidebar ul.spicesocialwidget li.facebook a:hover{ background-position:0 -32px}
ul.spicesocialwidget li.googleplus a:hover, #sidebar ul.spicesocialwidget li.googleplus a:hover{ background-position:-96px -32px}
ul.spicesocialwidget li.rss a:hover, #sidebar ul.spicesocialwidget li.rss a:hover{ background-position:-192px -32px}
ul.spicesocialwidget li.twitter a:hover, #sidebar ul.spicesocialwidget li.twitter a:hover{ background-position:-256px -32px}
ul.spicesocialwidget li.youtube a:hover, #sidebar ul.spicesocialwidget li.youtube a:hover{ background-position:-320px -32px}
</style>
<ul class="spicesocialwidget">
<li class="rss">
<a rel="nofollow" href="http://feeds.feedburner.com/techsperia" target="_blank" title="RSS Feeds"></a></li>
<li class="facebook">
<a rel="nofollow" href="http://www.facebook.com/xxxx" target="_blank" title="Facebook"></a></li>
<li class="googleplus">
<a rel="nofollow" href="https://www.plus.google.com/107015367605965056336" target="_blank" title="Google Plus"></a></li>
<li class="twitter">
<a rel="nofollow" href="http://www.twitter.com/xxxx" target="_blank" title="Twitter"></a></li>
<li class="youtube">
<a rel="nofollow" href="http://www.youtube.com/xxxx" target="_blank" title="YouTube"></a></li>
</ul>


Replace the text highlighted in blue with your respective social links. Also, if you don't want a particular icon to appear, simply remove it's entire <li> tag.

Example: Suppose you don't have a YouTube channel and hence, don't want the youtube-icon to appear, simply remove the entire <li> tag with the class "youtube" (you can do the same for others):

<li class="youtube">
<a rel="nofollow" href="http://www.youtube.com/xxxx" target="_blank" title="YouTube"></a></li>

These icons (being small) are better suited in the footer or header of the blog. However, for new bloggers who don't know where to paste the code, I do recommend creating a new HTML/JavaScript gadget and pasting the above code in there.

For the sake of simplicity, I have only included the icons of RSS, Facebook, Google+, Twitter and YouTube because these social networks are most widely used.

If you want, I can give you the code of other social media icons as well. Just leave a comment below :) Here's a demo of all the social media icons:

Live Demo of ALL icons: 







No comments:

Post a Comment