What's wrong with this TranslateY animation in CSS ?[Solved] | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

What's wrong with this TranslateY animation in CSS ?[Solved]

In this code, the positions of both boxes resets to their default positions after translateY animation, why??? somebody help. https://code.sololearn.com/WFKmGq4Ir45C/?ref=app

9th Jun 2020, 6:57 AM
Shreyansh Gaurav
Shreyansh Gaurav - avatar
2 Answers
+ 4
i think by default the elements will go back to their original position after animation end.. probably what u want is animation-fill-mode: forwards; add this to the elements that have animation run on
9th Jun 2020, 7:03 AM
durian
durian - avatar
+ 1
Thanks a ton!! Didn't know that property. That's just what i needed in my code.
9th Jun 2020, 7:19 AM
Shreyansh Gaurav
Shreyansh Gaurav - avatar