JSFiddle - React, Tailwind, and code Playground
by Vince Richter
HTML
<div id="wrapper">
<div class="btn1">
<p></p>
</div>
CSS
* {
margin: 0;
padding: 0;
}
body {
background: #00bfb6;
font-family: arial;
}
#wrapper {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.btn1{
width: 220px;
height: 45px;
line-height: 45px;
position: relative;
cursor: pointer;
border: 3px solid #fff;
margin: 30px 0;
overflow: hidden;
}
#wrapper div > p {
position: relative;
z-index: 1;
color: #fff;
font-weight: 900;
text-transform: uppercase;
text-align: center;
transition: all 1s ease;
}
.btn1:before {
content: "";
position: absolute;
top: 0;
left: 0;
background: #fff;
width: 100%;
height: 100%;
transition: all 1s ease;
}
.btn1:before {
top: -50px;
}
#wrapper div > p:hover {
color: #00bfb6;
transition: all 1s ease;
}
.btn1:hover:before{
top: 0px;
transition: all 1s ease;
}