Tell us what’s happening:
I’m not having any trouble with the challenge itself, however I’ve noticed that when I do hover over the button it changes color but the goes back to its original state, looking very abrupt and unprofessional. On most professional websites, if a button is to do this when a user hovers over it, then that button will stay that color until the user removes his mouse cursor from that button. Is there any way that I can do this with my site?
edit: ok so yeah, I just realized that the challenge immediately after addresses this issue. This thread is now useless.
Your code so far
<style>
button {
border-radius: 5px;
color: white;
background-color: #0F5897;
padding: 5px 10px 8px 10px;
}
button:hover {
animation-name: background-color;
animation-duration: 500ms;
}
@keyframes background-color {
100% {
background-color: #4791d0;
}
}
</style>
<button>Register</button>
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/responsive-web-design/applied-visual-design/use-css-animation-to-change-the-hover-state-of-a-button