JSFiddle - React, Tailwind, and code Playground

by Jesse M

HTML

<a href="#">Link Text</a>

CSS

a {
  background: #000;
  position: relative;
  width: 300px;
  height: 60px;
  display: block;
  text-align: center;
}

a:before, a:after {
  transition: all 0.3s ease-in-out;
}

a:before {
  content: "";
  position: absolute;
  display: block;
  top: 0;
  left: 0;
  width: 30px;
  height: 30px;
  background: #F00;
  z-index: -1;
}

a:after {
  content: "";
  position: absolute;
  display: block;
  bottom: 0;
  right: 0;
  width: 30px;
  height: 30px;
  background: #F00;
  z-index: -1;
}

a:hover:before {
  top: -30px;
  left: -30px;
}

a:hover:after {
  bottom: -30px;
  right: -30px;
}