Play Gif image in HTML with infinite loop

2020-08-21 03:08发布

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?

1条回答
疯言疯语
2楼-- · 2020-08-21 03:50

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.

查看更多
登录 后发表回答