53
<div class="container">
<a href="#" class="btn btn-1">Button Hover</a>
</div>
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
body{
background-color: #229955;
}
.container{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.btn{
color: #fff;
text-decoration: none;
text-transform: uppercase;
font-size: 20px;
max-width: 200px;
display: block;
position: relative;
line-height: 45px;
padding: 5px 10px;
}
.btn-1{
border: 1px solid;
overflow: hidden;
position: relative;
}
.btn-1:before{
content: '';
position: absolute;
top: -50px;
left: -100px;
width: 50px;
height: 150px;
background-color: #fff;
transform: rotate(45deg);
opacity: .2;
transition: .6s;
}
.btn-1:hover:before{
left: 150px;
}
CSS hover effects allow elements to load quickly. Most web designers prefer CSS animations as they are easy to employ.