button slanted slide on hover code example

Example: button slanted slide on hover

div {
  position: relative;
  display: inline-block;
  padding: 15px 70px;
  border: 5px solid #B17461;
  color: #B17461;
  font-size: 30px;
  font-family: arial;
  transition: color .5s;
  overflow:hidden;
}
div:before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 130%; height: 100%;
  background: #B17461;
  z-index: -1;
  transform-origin:0 0 ;
  transform:translateX(-100%) skewX(-45deg);
  transition: transform .5s;
}
div:hover {
  color: #fff;
}
div:hover:before {
  transform: translateX(0) skewX(-45deg);
}

Tags:

Css Example