Both the block and the character are jumping pls help | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Both the block and the character are jumping pls help

Try fixing this body { } #game{ width:500px; height:200px; border: 1px solid black; } #character{ width:20px; height:50px; background-color:blue; position:relative; top:150px; animation: jump 500ms infinite; } @keyframes jump{ 0%{top:150px;} 30%{top:100px;} 70%{top:100px;} 100%{top:150px; } #block { Width:20px; Height:20px; Background-corlor:red; }

15th Oct 2022, 8:11 AM
daniels
2 Answers
+ 4
What if you move the block code above the key frames/character? If you can share your code here from the code playground, someone can probably find the answer more easily and exactly.
15th Oct 2022, 8:16 AM
Ausgrindtube
Ausgrindtube - avatar
+ 2
In the keyframes, the closing } for 100% is missing In #block, the attributes are with capital letter.
15th Oct 2022, 9:34 AM
Lisa
Lisa - avatar