In today's digital age, connecting with your audience is crucial. While standard social media links are functional, they can be boring. Why not add some life to your blog with Animated Social Media Icons?
In this tutorial, I will share a clean CSS code snippet that creates stylish social media buttons. When a visitor hovers over an icon, it smoothly bounces up and changes color. This micro-interaction encourages users to click and follow your profiles.
Why use these CSS Icons?
- Attention Grabbing: The bouncing animation naturally draws attention to your social links.
- Zero Images: These icons use Font Awesome and CSS, so they load instantly without slowing down your site.
- Clean Design: A modern, flat design that fits perfectly with any blog theme.
- Easy to Update: You can add or remove icons simply by copying a single line of HTML.
Live Preview
Hover your mouse over the icons below to see the bouncing effect and color change!
HTML & CSS Code
Copy the code below and paste it into your blog post or an HTML widget in your sidebar.
<style>
.social-container {
display: flex;
justify-content: center;
gap: 20px;
}
.social-btn {
display: flex;
justify-content: center;
align-items: center;
width: 50px;
height: 50px;
background: #fff;
border-radius: 50%;
box-shadow: 0 5px 15px rgba(0,0,0,0.1);
text-decoration: none;
font-size: 20px;
color: #555;
transition: 0.3s;
}
.social-btn:hover {
transform: translateY(-5px);
color: #fff;
}
/* Brand Colors */
.facebook:hover { background: #3b5998; }
.twitter:hover { background: #1da1f2; }
.instagram:hover { background: #e1306c; }
.youtube:hover { background: #ff0000; }
</style>
<!-- Icons HTML -->
<div class="social-container">
<a href="#" class="social-btn facebook"><i class="fab fa-facebook-f"></i></a>
<a href="#" class="social-btn twitter"><i class="fab fa-twitter"></i></a>
<a href="#" class="social-btn instagram"><i class="fab fa-instagram"></i></a>
<a href="#" class="social-btn youtube"><i class="fab fa-youtube"></i></a>
</div>
How to Customize
Customizing these icons is very simple. Here is a detailed guide on how to change links, colors, and sizes.
1. How to Add Your Profile Links
Currently, the links are set to #. To link to your actual profiles, look for the href="#" part in the HTML code. Replace the # with your full URL.
Example:
<a href="https://facebook.com/YourPage" ... >
2. How to Change Colors
I have used the official brand colors for Facebook, Twitter, Instagram, and YouTube. If you want to change them to match your blog's theme (for example, all black or all orange), look at the /* Brand Colors */ section in the CSS.
- To make Facebook green, change
#3b5998to#00ff00. - To make them all black on hover, change all color codes to
#000000.
3. How to Change the Size
If you want larger icons, find the .social-btn class in the CSS.
- Change
width: 50px;to60pxor larger. - Change
height: 50px;to match the width. - Change
font-size: 20px;to25pxto make the icon inside bigger.
Conclusion
Adding animated social media icons is a quick win for your blog's design and user engagement. It makes your site look professional and encourages visitors to connect with you. If you found this code helpful, please share this post and leave a comment below!