html 中的 <img> 标签是否支持 gif 动画?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8462975/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 11:56:16  来源:igfitidea点击:

Do <img> tags in html support animated gifs?

htmlimagegifanimated-gif

提问by H Bellamy

I am making a photo upload site, and began to wonder: Do <img>tags in html support animated gifs, and can they actually show animated gifs in their image?

我正在制作一个照片上传网站,并开始怀疑:<img>html中的标签是否支持gif动画,它们实际上可以在其图像中显示动画gif吗?

Also, if <img>tags don'tsupport animated gifs, is there a way to implement that cross browser?

另外,如果<img>标签支持动画 gif,有没有办法实现跨浏览器?

Thanks

谢谢

回答by splattne

Yes

是的

回答by Oded

The imgtag has nothing to do with it - it's the browser rendering engine that needs to support them.

img标签有什么关系呢-这是浏览器渲染引擎需要支持他们。

And as far as I know, allthe mainstream ones support animated gifs, though some give the user control over only showing the animation once(why? because they can be incredibly annoying. Think carefully before using them).

据我所知,所有主流都支持 gif 动画,尽管有些让用户控制只显示一次动画(为什么?因为它们非常烦人。使用前请仔细考虑)。