I tried displaying a gif animated image inside my HTML code like
<img src="preview.gif" loop=infinite />
With or without the loop tag , it always plays once only.
Any help to make it loop continuously?
I tried displaying a gif animated image inside my HTML code like
<img src="preview.gif" loop=infinite />
With or without the loop tag , it always plays once only.
Any help to make it loop continuously?
Looping is encoded into the GIF itself, not the img
tag. Open the GIF in an image editor and change the mode to loop, or use a different GIF. The loop
attribute is an invalid, deprecated attribute only meant to work when the src
is a video.
As mentioned it is encoded into the GIF but you can change it with tools like photoshop for this:
The infinite attribute has no effect on the image. You have to store the infinite on the gif itself in case you generate it on the backend.