How To Build Button Hover Animation with HTML & CSS

Easy but eye catching CSS submit buttons hover effects, by animating the “:before” and “:after” pseudo elements.

HTML Code:

  <div class="container">
    <a href="#" class="btn btn-1">Button Hover</a>

CSS Code:

  margin: 0;
  padding: 0;
  box-sizing: border-box;
  background-color: #229955;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  text-decoration: none;
  text-transform: uppercase;
  font-size: 20px;
  max-width: 200px;
  display: block;
  position: relative;
  line-height: 45px;
  padding: 5px 10px;
  border: 1px solid;
  overflow: hidden;
  position: relative;
  content: '';
  position: absolute;
  top: -50px;
  left: -100px;
  width: 50px;
  height: 150px;
  background-color: #fff;
  transform: rotate(45deg);
  opacity: .2;
  transition: .6s;
  left: 150px;
RH Suman
RH Suman
Articles: 64

Newsletter Updates

Enter your email address below to subscribe to our newsletter

Leave a Reply