Animated Button Create in CSS-3

Html

--------------------

<div class="btneffect"><a href="">Button</a></div>


Css
-----------------

body{
margin: 0px; padding: 0px; list-style: none; display: flex; align-items: center; justify-content: center;
}

.btneffect{ float: left;}
.btneffect a{position: relative; padding: 15px 40px; border: 2px solid #000; font-family: sans-serif; text-decoration: none; text-transform: uppercase; font-size: 24px; display: block; box-sizing: border-box; border-radius: 32px; color:#000; overflow: hidden;
}
.btneffect a:hover{ color: #fff;  transition-delay: 1s;}

 
.btneffect a:before{
content: ''; position: absolute; left: 60px; top: 50%; transform: translateY(-50%) scale(.6);
width: 10px; height: 10px;  background: #ff0052; border-radius: 50%; z-index: -1; transition-property: left, transform;  transition-delay: 0s,0s; transition-duration: 1s,0.5s; opacity: 0;

.btneffect a:hover:before{left: 10px; transform: translateY(-50%) scale(20); transition-delay: 0s,1s; opacity: 1;}
 

.btneffect a:after{content: ''; position: absolute; right: 60px; top: 50%; transform: translateY(-50%) scale(.6); width: 10px; height: 10px;  background: #ff0052; border-radius: 50%; z-index: -1; transition-property: right, transform;  transition-delay: 0s,0s; transition-duration: 1s,0.5s; opacity: 0;
}
.btneffect a:hover:after{
right: 10px; transform: translateY(-50%) scale(20); transition-delay: 0s,1s; opacity: 1;
}



No comments:

Post a Comment