Create Movement Using CSS Animation 2

Tell us what’s happening:

Your code so far

  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;
    right: 0px;
  50% {
    background-color: green;
    left: 50px;
  100% {
    background-color: yellow;
    left: 0px;

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

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36.

Link to the challenge:

what is your question?

the code wasnt able to pass the tests … now i have passed the test … thanks …

Try doing it yourself for sometime before posting it here. Try going on as long as you can without giving up so fast. Most probably there is already a post about this topic.