Looking for a nice ripple effect on links and buttons when they are hovered?
Demo:
Hover meHere’s the CSS for that:
.ripple {
/*background: #79b928;
color: #fff;*/
padding: 20px 23px;
position: relative;
overflow: hidden;
}
.ripple::before {
content: "";
position: absolute;
background-color: rgba(0,0,0,.1);
width: 10%;
height: 25%;
border-radius: 50%;
z-index: 1;
top: 35%;
left: 45%;
-webkit-transform: scale(0);
transform: scale(0);
}
/*.ripple:hover {
background: #74b126;
color: #fff;
}*/
.ripple:hover::before {
-webkit-transform: scale(12);
transform: scale(12);
-webkit-transition: border-radius .5s .5s,-webkit-transform .5s;
transition: border-radius .5s .5s,-webkit-transform .5s;
transition: transform .5s,border-radius .5s .5s;
transition: transform .5s,border-radius .5s .5s,-webkit-transform .5s;
}
.ripple:hover::after {
content: "";
position: absolute;
z-index: 2;
left: 50%;
-webkit-transform: translateX(-50%);
transform: translateX(-50%);
}
Add ripple
class to a
elements and/or button
elements for which you wish to apply the effect.