开发者

Automed CSSSprites -- csssprites.org

开发者 https://www.devze.com 2023-01-02 10:31 出处:网络
If this is a question that shouldn\'t be on SO, please let me know. Has anyone tried the website: http://csssprites.org/

If this is a question that shouldn't be on SO, please let me know.

Has anyone tried the website:

http://csssprites.org/

To autogenerate and use CSS Sprites? What ar开发者_如何学Ce your thoughts? I'm thinking about implementing (constantly looking for new ways to improve performance)


Yes, sprites speed up a site because

  • less HTTP requests
  • avoid small overhead every image has

They make sense for icons etc

Downsides are

  • More difficult to change one icon
  • Can't cache control individual icons


I used CSS Sprites to create my first sprite, but I tend to chop them together myself now as I personally find it easier to create strips-of-sprites (i.e. long and thin) rather than big square sprites as its easier to update them if you understand the convention used to create them.


If you are using .net, check out http://www.RequestReduce.com. It not only creates the sprite file automatically, but it does it on the fly through an HttpModule along with merging and minifying all CSS. It lso optimizes the sprite image using quantization and lossless compression and it handles the serving of the generated files using ETags and Expires headers to ensure optimal browser caching. The setup is trivial involving just a simple web.config change. See my blog post about its adoption by the Microsoft Visual Studio and MSDN Samples gallery.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号