2

This has the video of the problem https://files.fm/u/pvuv6shbx

I still want the hover animation of it sliding to the right but I dont want the button and title to move upwards when I hover.

Button code

button{
  width: 200px;
  padding: 15px 0;
  text-align: center;
  margin: 20px 10px;
  border-radius: 25px;
  font-weight: bold;
  border: 2px solid #0da7ce;
  background: transparent;
  color: white;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 10px #0da7ce;
}

Button animation code

span{
  background: #0da7ce;
  height: 100%;
  width: 0;
  border-radius: 25px;
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: -1;
  transition: 0.5s;
}

button:hover span{
  width: 100%;
}

button:hover{
  border: none;
}
Gedeon Mutshipayi
  • 2,871
  • 3
  • 21
  • 42

3 Answers3

1

Just put border the same color of the background

button:hover{
        border-color: #0da7ce;
 }
0

just simple change the border-color

button:hover{
    border-color: transparent;
}
0

Change this in your CSS :

button:hover{
    border: none;
}

to

button:hover{
    border: 2px solid transparent;
}