<div>
<a class="effect1" href="#">
Let's Go!
<span class="bg"></span>
</a>
</div>
<!--
The size of the button is scaled 3x using css. You can reduce it to 1x. See the CSS.
-->
* {
margin: 0;
padding: 0;
}
html,
body {
height: 100%;
}
div {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
height: 100%;
background: #eee;
}
.effect1 {
color: #222;
text-decoration: none;
font-family: sans-serif;
font-size: 24px;
position: relative;
padding: 10px 50px 10px 20px;
-webkit-transition: all 0.3s;
-o-transition: all 0.3s;
transition: all 0.3s;
-webkit-transform: scale(3);
-ms-transform: scale(3);
transform: scale(3); /*change scale(3) to scale(1)*/
}
.effect1 .bg {
background: #222;
width: 30px;
height: 2px;
position: absolute;
right: 0;
top: 50%;
margin-top: -1px;
z-index: -1;
-webkit-transition: all 0.3s;
-o-transition: all 0.3s;
transition: all 0.3s;
}
.effect1:hover {
padding-right: 20px;
color: #fff;
}
.effect1:hover .bg {
height: 100%;
width: 100%;
-webkit-transform: translate(0, -50%);
-ms-transform: translate(0, -50%);
transform: translate(0, -50%);
}
.effect1 .bg:before, .effect1 .bg:after {
content: '';
height: 2px;
width: 10px;
background: #222;
position: absolute;
right: -2px;
-webkit-transition: all 0.3s;
-o-transition: all 0.3s;
transition: all 0.3s;
}
.effect1 .bg:before {
bottom: 3px;
-webkit-transform: rotate(45deg);
-ms-transform: rotate(45deg);
transform: rotate(45deg);
}
.effect1 .bg:after{
top: 3px;
-webkit-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
transform: rotate(-45deg);
}
.effect1:hover .bg:before,
.effect1:hover .bg:after{
right: 0;
}
.effect1:hover .bg:before{
bottom: 6px;
}
.effect1:hover .bg:after{
top: 6px;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.