Next-Gen App & Browser
Testing Cloud
Trusted by 2 Mn+ QAs & Devs to accelerate their release cycles
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;}
}
KaneAI - Testing Assistant
World’s first AI-Native E2E testing agent.