Cool Button hover animation 2 with html & css

RH Suman
July 6, 2022

106

Easy but eye catching CSS submit buttons hover effects, by animating the “:before” and “:after” pseudo elements.
Cool Button hover animation 2 with html & css

HTML Code:

 <div class="container">
    <a href="http://www.deshamarbd.com/" class="btn btn-2" target="blank">Button Hover</a>
  </div>

CSS Code:

*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body{
  background-color: #229955;
}
.container{
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.btn{
  color: #fff;
  text-decoration: none;
  text-transform: uppercase;
  font-size: 20px;
  max-width: 200px;
  display: block;
  position: relative;
  line-height: 45px;
  padding: 5px 10px;
}
.btn-2 {
  border: 0 solid;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0);
  outline: 1px solid;
  outline-color: rgba(255, 255, 255, 0.5);
  outline-offset: 0px;
  text-shadow: none;
  transition: .5s;
}

.btn-2:hover {
  border: 1px solid;
  box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.5), 0 0 20px rgba(255, 255, 255, 0.2);
  outline-color: rgba(255, 255, 255, 0);
  outline-offset: 15px;
  text-shadow: 1px 1px 2px #427388;
}

Preview:

Tags

HTML CSS Animation Hover Button

Subscribe

Get Updates

Subscribe our newsletter to get the last update into your inbox!

Please insert email address.

Recommended Posts