用HTML无限循环播放Gif图像(Play Gif image in HTML with infinite loop)

编程入门 行业动态 更新时间:2024-10-26 12:32:09
用HTML无限循环播放Gif图像(Play Gif image in HTML with infinite loop)

我尝试在我的HTML代码中显示一个gif动画图像

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

无论有没有循环标记,它总是只播放一次。

任何帮助,使其不断循环?

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?

最满意答案

循环编码到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.

更多推荐

本文发布于:2023-07-29 05:09:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1312626.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:图像   Gif   HTML   Play   loop

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!