Hover Button Effects
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<a href="#">Button
<span></span>
<span></span>
<span></span>
<span></span>
</a>
<style type="text/css">
body{
margin: 0px;
padding: 0px;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
font-family: sans-serif;
background-color: #000;
}
a{
position: absolute;
display: block;
padding: 20px 40px;
text-transform: uppercase;
text-decoration: none;
color: #fff;
font-size: 24px;
letter-spacing: 2px;
overflow: hidden;
}
a:before{
content: '';
position: absolute;
width: 100%;
height: 100%;
top: 0px;
left: -100%;
background: #fff;
transition: 0.5s;
transition-delay: 0.5s;
}
a:hover:before{
left: 100%;
}
a span:nth-child(odd){
position: absolute;
display: block;
width: 100%;
height: 2px;
background-color: #fff;
transition: 0.5s ease-in-out;
}
a span:nth-child(1){
top: 0px;
left: 50%;
}
a span:nth-child(3){
bottom: 0px;
right: 50%;
}
a span:nth-child(even){
position: absolute;
display: block;
width: 2px;
height: 100%;
background-color: #fff;
transition: 0.5s ease-in-out;
}
a span:nth-child(2){
top: 50%;
left: 0%;
}
a span:nth-child(4){
bottom: 50%;
right: 0;
}
a:hover span:nth-child(1){
top: 0px;
left: -50%;
}
a:hover span:nth-child(3){
bottom: 0px;
right: -50%;
}
a:hover span:nth-child(2){
top: -50%;
left: 0%;
}
a:hover span:nth-child(4){
bottom: -50%;
right: 0;
}
</style>
</body>
</html>
Comments
Post a Comment