gpt4 book ai didi

css - 如何将动画 gif 添加到图像 Sprite ?

转载 作者:行者123 更新时间:2023-11-28 18:37:26 32 4
gpt4 key购买 nike

我使用图像/css sprites 来优化我正在处理的网页,其中经常需要的东西之一是某种动画加载图标,通常是动画 .gif 文件。

是否可以将动画 gif 添加到图像 sprite(并且不必为整个 sprite 使用 gif)?如果是这样,我该怎么做?是否有任何其他图像格式支持动画?

最佳答案

Is it possible to add an animated gif to an image sprite (and not have to use gif for the whole sprite)?

不,这是不可能的。整个 Sprite 表要么是 GIF,要么不是。你不能在一个 Sprite 中混合文件类型。您可以将所有 GIF Sprite 放入一张表中(如果它们的帧都可以被彼此整除),并将所有 PNG/JPG Sprite 放入第二张表中,并单独使用它们。

Do any other image formats support animation?

唯一支持动画的其他格式(据我所知)是 APNG , 但它仅在 Firefox 中受支持。 (Chrome 有一个支持它的错误扩展。)

关于css - 如何将动画 gif 添加到图像 Sprite ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12357579/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com