I am trying to achieve this effect for a button:
I struggled with it for a couple of hours, and best of all I could come up with this CodePen .
<a href="#" class="btn-wrap">
<span class="btn btn-primary">See the Proof</span>
</a>
.btn {
border: 0;
border-radius: 0;
font-weight: 300;
font-size: 20px;
text-transform: uppercase;
}
.btn-primary {
position: relative;
-webkit-transition: all .2s ease;
-moz-transition: all .2s ease;
transition: all .2s ease;
}
.btn-primary:before, .btn-primary:after {
position: absolute;
content: '';
right: -20px;
width: 10px;
height: 50%;
background: inherit;
}
.btn-primary:before {
top: 0;
transform: skewX(30deg);
}
.btn-primary:after {
bottom: 0;
transform: skewX(-30deg);
}
.btn-wrap {
position: relative;
display: inline-block;
}
.btn-wrap:before, .btn-wrap:after {
position: absolute;
content: '';
right: -40px;
width: 10px;
height: 50%;
background: #337ab7;
-webkit-transition: all .2s ease;
-moz-transition: all .2s ease;
transition: all .2s ease;
}
.btn-wrap:hover:before, .btn-wrap:hover:after {
background: #23527c;
}
.btn-wrap:before {
top: 0;
transform: skewX(30deg);
}
.btn-wrap:after {
bottom: 0;
transform: skewX(-30deg);
}
I want it to work well to respond, so if the text is split into 2 lines, the arrows support the full height.
Any thoughts?
source
share