What seems to be the fault here . create movement using css animation

Tell us what’s happening:

Your code so far


<style>
div {
  height: 40px;
  width: 70%;
  background: black;
  margin: 50px auto;
  border-radius: 5px;
  position: relative;
}

#rect {
  animation-name: rainbow;
  animation-duration: 4s;
}

@keyframes rainbow {
  0% {
  background-color: blue;
    top: 0px;
left:0;
  }
  50% {   background-color: green;
    top: 50px;
left:25;
  }
100% {     background-color: yellow;
    top: 0px;
left:-25;
  }
}
</style>

<div id="rect"></div>

Your browser information:

User Agent is: Mozilla/5.0 (Linux; Android 8.1.0; itel A16 Plus) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Mobile Safari/537.36.

Challenge: Create Movement Using CSS Animation

Link to the challenge:

Hello,
You forgot to tell the program in what unit the movement will take place in all, 0%, 50% and 100%

0% {
  background-color: blue;
    top: 0px;
left:0;
1 Like