I want to add transition effects on buttons. When I will hover over on any button its background color will be transform blue to white and text color white to blue. Background color must be change from left to write in sliding manners.
I tried the following code.
btn {
transition-property: background-color;
transition-duration: 0.5s;
}
btn:hover {
background-color: blue;
color: white;
}
3
Answers
Since you have shared minimal code from your end, is this something you are looking for?
In the following, we are using a horizontal linear gradient (to left) and then we are increasing the background size by 200%. On hover, we are trying to move the background position thus creating an effect of the button getting filled with another color. Feel free to change the color values as you prefer.