JSFiddle - React, Tailwind, and code Playground
by Dinh Trieu
HTML
<div class="button_sliding_bg top">Explore Our Products</div>
<div class="button_sliding_bg bottom">Bottom to top</div>
<div class="button_sliding_bg left">Left to right</div>
<div class="button_sliding_bg right">Right to left</div>
<div class="button_sliding_bg center">Center</div>
CSS
.button_sliding_bg {
color: #31302B;
background: #FFF;
padding: 12px 17px;
margin: 25px;
font-family: 'OpenSansBold', sans-serif;
border: 3px solid #31302B;
font-size: 14px;
font-weight: bold;
letter-spacing: 1px;
text-transform: uppercase;
border-radius: 2px;
display: inline-block;
text-align: center;
cursor: pointer;
box-shadow: inset 0 0 0 0 #31302B;
-webkit-transition: all ease 0.8s;
-moz-transition: all ease 0.8s;
transition: all ease 0.8s;
}
.top:hover {
box-shadow: inset 0 100px 0 0 #31302B;
color: #FFF;
}
.bottom:hover {
box-shadow: inset 0 -100px 0 0 #31302B;
color: #FFF;
}
.left:hover {
box-shadow: inset 200px 0px 0 0 #31302B;
color: #FFF;
}
.right:hover {
box-shadow: inset -200px 0px 0 0px #31302B;
color: #FFF;
}
.center:hover {
box-shadow: inset 0px 0px 0 200px #31302B;
color: #FFF;
}