是否有任何网络应用程序可以将小图像合并为单个图像?

发布于 2024-09-19 12:41:40 字数 306 浏览 4 评论 0原文

是否有任何应用程序可以将小图像合并到 Web 应用程序中的单个图像中,以减少 HTTP 请求并加快页面加载速度?

GWT 自动执行此操作,并制作适当的图像 + CSS 样式来显示这些图像。当我有一个普通的 HTML + CSS 时,是否有一个辅助应用程序,它给定 HTML + CSS + 一堆小图像,输出正确的 HTML + CSS + 单图像?

例如,请参阅此 Google 图片

Is there any application to merge small images into a single one in a web application in order to make less HTTP request and have the page load faster?

GWT does this automatically and makes proper images + CSS styles to show those images. When I have a plain HTML + CSS is there a helper application which given HTML + CSS + a bunch of small images, outputs a proper HTML + CSS + Single Image?

See for example this Google image.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

简单 2024-09-26 12:41:41

您正在寻找的技术称为 CSS sprites(下次谈论它时请记下这个名称)。

尽管您的要求(给他们您的代码,返回应用了精灵的相同代码)有点太多,但一些在线生成器确实很接近 - 它们会自动计算最佳图像放置并为您提供所需的 CSS。谷歌搜索 CSS Sprite Generator 可以得到一些非常好的结果,例如 http://spritegen.website-performance.org/

您应该注意,这些生成器并不完美,对于静态站点,您每次想要调整站点上的图形时都需要执行此操作。

The technique you're looking for is called CSS sprites (take note of this name the next time you talk about it).

Although what you're asking for (give them your code, get back same code with sprites applied) is a little too much, some online generators do come close - they will automatically calculate the most optimal image placement and give you the CSS needed for this. Googling for CSS Sprite Generator gets back some very good ones, like http://spritegen.website-performance.org/.

You should note that these generators are not perfect, and for static sites you will need to do this ever ytime you want to tweak the graphics on the site.

一抹苦笑 2024-09-26 12:41:41

你可以尝试SpriteMe

You could give SpriteMe a try

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文