加入收藏 | 设为首页 | 会员中心 | 我要投稿 河北网 (https://www.hebeiwang.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 创业 > 正文

CSS Sprites:实用技巧,还是潜在危险?[译]

发布时间:2018-09-13 02:42:51 所属栏目:创业 来源:站长网
导读:无处不在的CSS sprites是为数不多的几个可以绕过逐渐风行阶段,而直接让本身成为CSS最佳实践的Web计划能力中的一个。尽量在A List Apart对它举办一个表明以及拥护承认这种方法之前,它还没有真正地风行。它最早是由Petr Stancek.在2003年7月提出来作为一个

无处不在的CSS sprites——是为数不多的几个可以绕过“逐渐风行”阶段,而直接让本身成为CSS最佳实践的Web计划能力中的一个。尽量在A List Apart对它举办一个表明以及拥护承认这种方法之前,它还没有真正地风行。它最早是由Petr Stanícek.在2003年7月提出来作为一个CSS的办理方案。

Ah, the ubiquitous CSS sprites — one of the few web design techniques that was able to bypass “trend” status almost instantly, planting itself firmly into the category of best practice CSS. Although it didn’t really take off until well after A List Apart explained and endorsed it, it was discussed as a CSS solution as early as July, 2003 by Petr Stanícek.

当今很多web措施员对这项能力(CSS sprites)有着很娴熟的应用手段,先容CSS sprites的教程和文章也是不行胜数。险些在每一篇教程中,都要求计划师以及措施员应该实验CSS sprites以镌汰HTTP哀求和节减带宽。迄今为止,这项技能已经被很多网站所应用了,包罗亚马逊,正在行使着极大数目的sprites图片。

Most web developers today have a fairly strong grasp of this technique, and there have been countless tutorials and articles written on it. In almost every one of those tutorials, the claim is made that designers and developers should be implementing CSS sprites in order to minimize HTTP requests and save valuable kilobytes. This technique has been taken so far that many sites, including Amazon, now use mega sprites.

然则 这项技能被普及热议的带来的甜头真的值得么?计划师们是否可以在没颠末细心思量全部方面的身分的环境下转而行使CSS sprites?在这篇文章中,我未来接头一下CSS sprites的一些拥护可能阻挡行使CSS sprites的意见,尤其齐集在大量行使的sprites,以及为什么这样子行使CSS sprites在很多环境下是等同于挥霍时刻。

Is this much-discussed benefit really worthwhile? Are designers jumping on the CSS sprite bandwagon without a careful consideration of all the factors? In this article, I’m going to discuss some of the pros and cons of using CSS sprites, focusing particularly on the use of “mega” sprites, and why such use of sprites could in many cases be a waste of time.

原文地点  译者:solari

(编辑:河北网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    热点阅读