JSFiddle - React, Tailwind, and code Playground
by Kirouthika K
HTML
<a href="#"><span>button</span></a>
CSS
a{
padding: .7em 1.5em;
text-transform: uppercase;
font-weight: 600;
color: red;
line-height: 20px;
position: relative;
display: block;
margin: 0 .5em;
overflow: hidden;
-moz-transition: ease-out 0.3s 0.1s;
-o-transition: ease-out 0.3s 0.1s;
-webkit-transition: ease-out 0.3s;
-webkit-transition-delay: 0.1s;
transition: ease-out 0.3s 0.1s;
}
a:before{
position: absolute;
content: '';
height: 0;
width: 0;
border: 2px solid green;
left: 0;
bottom: 0;
box-sizing: border-box;
}
a:hover:before{
height: 50px;
width:110px;
border: 2px solid red;
border-bottom: none;
border-right: none;
border-top: none;
transition: height 0.5s linear, width 0.5s linear 0.5s;
}
a span:before{
position: absolute;
content: '';
height: 0;
width: 0;
border: 2px solid yellow;
left: 0;
top: 0;
box-sizing: border-box;
}
a span:hover:before{
height: 30px;
width:110px;
border: 2px solid red;
border-bottom: none;
border-right: none;
border-left: none;
transition: height 0.5s linear, width 0.5s linear 0.5s;
}
a span:after{
position: absolute;
content: '';
height: 0;
width: 0;
border: 2px solid purple;
right: 0;
top: 0;
box-sizing: border-box;
}
a span:hover:after{
height: 30px;
width:110px;
border: 2px solid red;
border-bottom: none;
border-top: none;
border-left: none;
transition: height 0.5s linear, width 0.5s linear 0.5s;
}
/* a:after{
position: absolute;
content: '';
height: 0;
width: 0;
border: 2px solid cyan;
left: 0;
bottom: 0;
box-sizing: border-box;
}
a:hover:after{
height: 30px;
width: 110px;
border: 2px solid red;
border-top: none;
border-right: none;
border-left: none;
border-bottom: none;
transition: height 0.5s linear, width 0.5s linear 0.5s;
} */