视频1 视频21 视频41 视频61 视频文章1 视频文章21 视频文章41 视频文章61 推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37 推荐39 推荐41 推荐43 推荐45 推荐47 推荐49 关键词1 关键词101 关键词201 关键词301 关键词401 关键词501 关键词601 关键词701 关键词801 关键词901 关键词1001 关键词1101 关键词1201 关键词1301 关键词1401 关键词1501 关键词1601 关键词1701 关键词1801 关键词1901 视频扩展1 视频扩展6 视频扩展11 视频扩展16 文章1 文章201 文章401 文章601 文章801 文章1001 资讯1 资讯501 资讯1001 资讯1501 标签1 标签501 标签1001 关键词1 关键词501 关键词1001 关键词1501 专题2001
图解CSS3读书笔记--前言_html/css
2020-11-27 16:35:21 责编:小采
文档

优雅降级

先考虑低端设备用户能否看到所有内容,然后再此基础之上为高端用户进行设计。
为高端设备用户提供一个完美的应用,也为不同性能级别的设备用户设计不同级别的不那么完美的应用。

引用一段stack overflow大神对渐进增强和优雅降级方式的解释

They ARE almost exactly the same thing, but they differ in
context.There is a class of browsers called "A Grade Browsers". These
are your typical audience members that (probably) make up the majority
of your visitors. You'll start with a baseline of these users. Call
this best modern practices.

If you want to enhance the experience for anyone happening to use
FF3.6 or Safari 4 or some other whizbang developer nightly webkit
whathaveyou, you'll want to do awesome things like rounded corners via
css shadowed text (but please god, not TOO much) drop shadows (see
above parenthetical) These make your site kick-ass looking, but won't
break it. This is progressive enhancement.Embracing the future from
the point of best practices.

On the other hand, your niche Nintendo site attracts a fair number of
IE5 users.Poor you, but you also want to make sure they keep coming
back. You might provide an alternative to your ajax behavior by
including the ajax script in an external file and if their JS isn't
turned on, maybe your links update the whole page. Etc. From the point
of view of best modern practices, you're making sure that certain
historical markets are being catered by some semblance of a functional
site. This is graceful degradation.

自己大概翻译一下:

其实这两种方式都是同一个概念,只是他们运用的背景不同。有一种浏览器叫做一级浏览器,这些大概会是你网站受众多数使用的浏览器,你将基于这一类比较高级的浏览器进行网站的设计制作。这种方式称为最佳现代实现。

现在举个栗子:如果你想提高如FF3.6或safari 4浏览器用户们访问你网站时的用户体验,你可能会加这些效果:css圆角、文字阴影等。这些特性会让你的网页看起来很眩酷,但是不会破坏原有的基础功能。这就是渐进增强。

但是这个时候你的网页有相当一部分的ie5用户。你不想失去他们,你可以为你的网页添加额外的文件来解决ie5下js打不开ajax脚本的问题,来为实现ajax行为提供另一种选择。或者直接用链接的方式打开整个页面。从现代最佳实践方式的角度来说,你要确保你的网页有类似功能来兼容拥有一定历史市场的低端浏览器。这就是优雅降级。

下载本文
显示全文
专题