智能合约逐步发放
Progressive enhancement is not only a smart idea, but it’s the right idea for anyone looking to produce cost-effective websites. It is alright if your site doesn’t look exactly the same in every browser. In fact, because of factors like font rendering, it’s impossible to maintain the exact same appearance across all browsers. Getting clients to accept that fact is important because it can save them both time and money (not to mention save you a few headaches).
渐进增强不仅是一个聪明的主意,而且对于希望创建具有成本效益的网站的任何人来说都是正确的主意。 如果您的网站在每种浏览器中看起来都不完全相同,那也没关系。 实际上,由于字体渲染等因素的影响,不可能在所有浏览器中都保持完全相同的外观。 让客户接受这一事实很重要,因为这可以节省他们的时间和金钱(更不用说为您省去一些麻烦了)。
Let’s take an example. Let’s say that our client, Great Sprockets Inc., wants a design with a few rounded corners and semi-transparent backgrounds sprinkled in. We decide not to use progressive enhancement. Everybody should get these rounded corners and semi-transparent backgrounds.
让我们举个例子。 假设我们的客户Great Sprockets Inc.想要一个带有一些圆角和半透明背景的设计。我们决定不使用渐进式增强。 每个人都应该获得这些圆角和半透明的背景。
So, we oblige. We create some 24-bit PNGs for the backgrounds. IE6 doesn’t support PNG24 transparency natively, so we add in a call to a script to fix that. We create a few images for the rounded corners, add a couple of extra element to our markup to position them, and we’re good to go.
因此,我们必须遵守。 我们为背景创建一些24位PNG。 IE6本机不支持PNG24透明性,因此我们添加了对脚本的调用来修复该问题。 我们为圆角创建了一些图像,在我们的标记中添加了两个额外的元素来定位它们,我们很高兴。
Now our other client, Even Greater Sprockets Inc., also wants rounded corners and semi-transparent backgrounds. However, recognizing that neither is important to the actual branding of the site, they agree to practice a bit of progressive enhancement.
现在,我们的其他客户,甚至Greater Sprockets Inc.,也希望获得圆角和半透明的背景。 但是,他们认识到这两者都不会对网站的实际品牌构成重要,因此他们同意进行逐步改进。
So, using two lines of CSS, we give rounded corners to all Firefox and Webkit-based browsers. Again, using CSS, we use RGBa to create semi-transparent backgrounds in the browsers that support them, and let others fall back to a fully opaque background color. And that’s it. No images, no extra Javascript calls, and no extra elements in our markup.
因此,使用两行CSS,我们为所有基于Firefox和Webkit的浏览器提供了圆角。 同样,使用CSS,我们使用RGBa在支持它们的浏览器中创建半透明背景,并使其他背景退回到完全不透明的背景颜色。 就是这样。 在我们的标记中没有图像,没有额外的Javascript调用,也没有额外的元素。
One client has ensured that every visitor to their site with a relatively modern browser, regardless of browser capabilities, gets rounded corners and semi-transparent backgrounds. As a result, they added time to the development of their site, and therefore money to their bill. In addition, they’ve increased the time it takes for their page to load by adding a few extra HTTP requests necessary to load the necessary images and scripts.
一位客户确保,无论浏览器功能如何,使用相对较新的浏览器访问其网站的每个访问者都会遇到圆角和半透明的背景。 结果,他们增加了网站开发的时间,因此增加了费用。 另外,他们通过添加一些额外的HTTP请求来加载页面和页面,这些HTTP请求用于加载必要的图像和脚本。
The other client has offered these embellishments only to browsers that support them natively. As a result, their development time is lower, and so is their bill and page load time. Their branding is still in tact, and their site still looks good, it’s just without a few added aesthetic touches.
另一客户仅将这些装饰提供给本地支持它们的浏览器。 结果,它们的开发时间缩短了,帐单和页面加载时间也缩短了。 他们的品牌仍然保持原样,他们的网站看起来仍然不错,只是没有一些额外的美学意义。
Which option makes more sense to you?
哪个选项对您更有意义?
翻译自: https://timkadlec.com/2009/06/developing-smarter-with-progressive-enhancement/
智能合约逐步发放