Hover Animation On Button
How to create hover animation on Button lets learn
Preview:
Click & Watch: Hover On Button
HTML:
<!DOCTYPE html>
<html>
<head>
<title>Hover Button</title>
</head>
<body>
<a href="#" class="btn">Hover Me</a>
</body>
</html>
CSS:
body{
background: #000;
}
.btn{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
text-decoration: none;
font-size: 18px;
padding: 20px 60px;
color: #fff;
}
.btn::before, .btn::after{
content: '';
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
box-sizing: border-box;
transition: top 0.5s,left 0.5s;
}
.btn::before{
border-left: 2px solid #f4005c;
border-top: 2px solid #f4005c;
}
.btn::after{
border-right: 2px solid #f4005c;
border-bottom: 2px solid #f4005c;
}
.btn:hover::before{
top: -5px;
left: -15px;
}
.btn:hover::after{
top: 5px;
left: 15px;
}
Some Useful Link:
Comments
Post a Comment