/* CSS for button interaction animation */
.button {
display: inline-block;
padding: 10px 20px;
background-color: #3498db;
color: #ffffff;
text-decoration: none;
border-radius: 5px;
transition: background-color 0.3s, transform 0.3s;
}
.button:hover {
background-color: #2980b9;
transform: scale(1.1);
}
CSS Button Interaction Animation
In this tutorial, we will learn how to create a button with a cool interaction animation using CSS.
When you hover over the button, it will change its background color and scale up slightly to give a nice interactive effect.
Here’s the CSS code for the button interaction animation:
.button {
display: inline-block;
padding: 10px 20px;
background-color: #3498db;
color: #ffffff;
text-decoration: none;
border-radius: 5px;
transition: background-color 0.3s, transform 0.3s;
}
.button:hover {
background-color: #2980b9;
transform: scale(1.1);
}
Feel free to customize the button styles and animation to suit your website’s design!