Perform automated and live-interactive testing on 3000+ real desktop and mobile devices online.
To move an image in HTML, you can use the CSS transform, CSS position, and CSS animation properties.
The <marquee> tag is also used to wrap around inside a <img> tag to move an image horizontally or vertically. However, it has been deprecated in HTML5 and is no longer supported in some browsers.
Let’s look at how to move an image in HTML using CSS - transform, position, and animation.
<img src="my_file.png" style="transform: translate(60px,120px);">
<div style="position: relative;">
<img src="my_file.png" style="position: absolute; left: 60px; top: 120px;">
</div>
<img src="my_file.png" style="animation: move 5s ease-in-out infinite;">
@keyframes move {
from {left: 0;}
to {left: 110px;}
}
Test your websites, web-apps, or mobile apps seamlessly with LambdaTest.
Start Free TestingEarn resume-worthy Selenium certifications that help you land a top job.
Learn MoreTest orchestration and execution cloud of 3000+ browsers and OS
24/7 support
Enterprise grade security
Fastest test execution cloud