+ 1
You can try to use @keyframes animation in CSS for that! For instance: index.html <!DOCTYPE html> <html> <head> <link rel="stylesheet" type="text/css" href="style.css"/> </head> <body> <img src="Horse.png" alt="Horse" id="horse"> </body> </html> style.css @keyframes horsemove{ 0%{ margin-top:10%; margin-left:10%; } 10%{ margin-top:20%; margin-left:0%; } /*etc etc... Make the margin attributes on your own!*/ } #horse{ animation:horsemove 3s linear infinite; }
21st Feb 2021, 11:22 AM
TheCoder
20th Feb 2021, 4:33 PM
Matias
Matias - avatar