CSS Lightning Button hover effects

CSS Lightning Button hover effects

HTML Code

<div class="container">
  <a href="#" class="btn">Hover to shine</a>
</div>

CSS Code

body  {
  padding: 0;
  margin: 0;
  background: #4e5454;
}
.container {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}
a {
  color: #f4f4f4;
  font-size: 1.5rem;
  padding: 1rem 3rem;
  text-decoration: none;
  text-transform: uppercase;
}
.btn {
  border: 1px solid rgb(146, 148, 248);
  position: relative;
  overflow: hidden;
}
.btn::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: -100%;
  background: linear-gradient(
  120deg,
  transparent,
  rgba(146, 148, 248, 0.4),
   transparent
  );
  transition: all 650ms;
}
.btn:hover::before {
  left: 100%;
}
Comments are closed.