@keyframes isn't working

In lesson 41 of Applied Visual Design, I am asked to use the @keyframes element in CSS to animate a button when hovered over. I put in the right code, checked for typos and ran it. One of the tests came up false multiple times, and I don’t know why. It shouldn’t be. It looks to me like I filled in all the right criteria, and when I hover over the button, the animation works. I don’t know if I’m just this tired that I’m missing something really obvious or what. Please help!

My Code


<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/81.0.4044.138 Safari/537.36.

Challenge: Use CSS Animation to Change the Hover State of a Button

Link to the challenge:

Try putting the semicolon ; at the end of this line. :upside_down_face:

2 Likes

Thanks so much!
Sometimes I am such an idiot and miss simple things like that. :no_mouth:

1 Like