Tell us what’s happening:
// running tests
The @keyframes rule for 50% should use the left offset of 25px.
The @keyframes rule for 100% should use the left offset of -25px.
// tests completed
However, if you look at the code the settings appear correct. What am I doing wrong?
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: 0px;
}
50% {
background-color: green;
top: 25px;
left: 25px;
}
100% {
background-color: yellow;
top: -15px;
left: -25px;
}
}
</style>
<div id="rect"></div>
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36
.