JSFiddle - React, Tailwind, and code Playground
by Dmitry Nazarov
HTML
<button class="custom-btn btn-3"><span>Read More</span></button>
CSS
.custom-btn {
padding: 10px 25px;
font-family: 'Roboto', sans-serif;
font-weight: 500;
background: transparent;
outline: none !important;
cursor: pointer;
transition: all 0.3s ease;
position: relative;
display: inline-block;
}.btn-3 {
width: 130px;
height: 40px;
line-height: 42px;
padding: 0;
border: none;
}
.btn-3 span {
position: relative;
display: block;
width: 100%;
height: 100%;
}
.btn-3:before, .btn-3:after {
position: absolute;
content: "";
right: 0;
top: 0;
background: #000;
transition: all 0.3s ease;
}
.btn-3:before {
height: 0%;
width: 2px;
}
.btn-3:after {
width: 0%;
height: 2px;
}
.btn-3:hover:before {height: 100%;}
.btn-3:hover:after {width: 100%;}
.btn-3 span:before, .btn-3 span:after {
position: absolute;
content: "";
left: 0;
bottom: 0;
background: #000;
transition: all 0.3s ease;
}
.btn-3 span:before {
width: 2px;
height: 0%;
}
.btn-3 span:after {
width: 0%;
height: 2px;
}
.btn-3 span:hover:before {height: 100%;}
.btn-3 span:hover:after {width: 100%;}