无限循环播放HTML中的Gif图像 [英] Play Gif image in HTML with infinite loop

查看:2629
本文介绍了无限循环播放HTML中的Gif图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在HTML代码中显示gif动画图像,例如

I tried displaying a gif animated image inside my HTML code like

<img src="preview.gif" loop=infinite />

无论是否带有loop标记,它始终只播放一次。

With or without the loop tag , it always plays once only.

是否有帮助使其不断循环?

Any help to make it loop continuously?

推荐答案

循环是编码到GIF本身,而不是 img 标记中。在图像编辑器中打开GIF并将模式更改为循环播放,或使用其他GIF。 loop 属性是无效的,不推荐使用的属性,仅当 src 是视频时才有效。

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.

这篇关于无限循环播放HTML中的Gif图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆