
A gentle fade is nice, but what if you want your hover color to slide in with flair? This effect is surprisingly simple—and can give your buttons a distinctive, eye-catching feel.
Here, the slide is created using an inset box-shadow. While typically used for casting shadows, box-shadow can also be inset to simulate a color overlay. Paired with a transition rule, this lets the color “fill” the button from left to right on hover.
Copy to clipboard<a href='#'><div id='button-example-1605'>Click here!</div></a>
Copy to clipboard#button-example-1605 {
color: #fffff7; background-color: #2B1412; padding: 20px 40px; font-size: 18px; font-weight: 600; width: 200px; text-align: center; box-shadow: inset 0 0 #D0A7A2; transition: ease-out 0.5s;
}#button-example-1605:hover {
box-shadow: inset 280px 0 #D0A7A2;
}
