The Zen of CSS(翻译)(1)

来源:互联网 发布:淘宝首页推广多少钱 编辑:程序博客网 时间:2024/05/05 21:58

禅意CSS

第一章       源作品欣赏

起源

抛开一切限制我们思想的桎梏吧!HTML诞生的使命仅仅是为了少数研究论文所使用的一种简单的语言。而浏览器厂商和众多网页设计师们却对它有限的设计能力颇有微词。类似<Font>与表格元素的滥用,已经破坏了HTML创建的初衷。

 

基本元素的滥用导致的是实际效果与原先设计的意图相去甚远;有特殊效用的元素反而被忽视,仅仅是由于他们看起来并不那么讨好。为了使站点看上去漂亮一点,正确的架构方法反而被忽略。

当然了,各大主流的浏览器厂商并没有为我们提供足够的支持。这一行为导致的必然结果是,情况并没有变好,反而更坏了。最大的两个浏览器 IE Netscape 在这场旷日持久的浏览器大战中,为了保持自己的领先优势,开发了更多的扩展程序。这场大战带来了创新,却带来了更大的不便:网页作者辛辛苦苦写出来的代码,在两个不同浏览器上显示的结果完全不同。

总而言之,混乱已经造成了。尽管存在着这样那样的问题,大量的金钱仍然被不断的投入.com潮中。只要想想,为了适应这两个浏览器所花费的成本,我们的浪费不难估计。终有一日,浏览器内容提供商们和互联网投资者终于不愿再承受这一负担。

 

改变之始

       在新千年到来之际,政府没有为web服务提供足够的预算。在这一时期的经济滑坡中,剩下的一部分尚未失去工作的web工作者们很快认识到,已经不再值得为这两个毫不标准且问题多多的浏览器耗费时间了,是时候做些改变了。

       一个自由网页设计者们自发的草根组织,他们把自己命名为Web Stands Project(WaSP;www.webstandards.org)试图与主要的浏览器厂商合作,并推行W3C组织方面的建议。在这一过程中,W3C组织为Web标准化运动投入了巨大的支持。终于,网页设计者们能够使他们复杂的HTML作品在不同的浏览器或者操作系统下不再产生太大的偏差了。

Pic1 网页标准项目

W3C为编码创造了更多的规范,使得一般的网页设计者们已经不必担心编码的构造问题。事实上,早在HTML刚刚标准化的90年代初,W3C组织已经创建了一系列的代码规范,用于解决兼容性、可用性、和更容易为视众接受的风格。

注释:

       W3C组织为Web的发展做出了巨大的贡献。早在1996年,W3C组织就已经开始不断地为互联网上呈现的各种各样的问题提供解决方案。

原文

Genesis

And push the limits we did. HTML began its life as a simple language for tagging research papers. Browser vendors and graphic designers took one look at its lack of layout capabilities and gave it a great big thumbs-down. Tricks and hacks like <FONT> tags and the misappropriation of the table element were developed to overcome these limitationshacks that undermined the very structural purposes for which HTML was developed in the first place.

Basic elements were misused for layout effects completely unrelated to their original intended purposes; elements with specific functions were ignored because they didn't look very nice. Proper structure was ignored in favor of a site's visuals.

Of course, the major browser manufacturers at the time weren't helping. Before the situation got better, it seemed that it was going to have to get worse. The two major playersMicrosoft and Netscapekept heaping proprietary extension on top of proprietary extension to keep ahead of each other as the famed Browser Wars waged. While competition keeps innovation alive, it can also stifle; Web authors were forced to deal with multiple versions of the same site because HTML coded for one browser rarely worked as expected in another, if at all.

In short, it was a big mess. The sacks of money carelessly thrown around during the dot-com boom aided the Web's continued growth despite the problems. A budget for two versions of the same site was easy to justify when the money flowed. However, by the turn of the millennium, both content authors and investors had finally had enough.

The Beginning of a Change

Early in the new century, Web budgets shriveled as capital dried up. While the economy took a nosedive, those who still had jobs quickly realized that the extra work of coding for broken and nonstandard browsers was too much to sustain; something had to be done.

A grassroots organization of Web designers who called themselves the Web Standards Project (or WaSP; www.webstandards.org) (FIGURE 1) worked with the major browser manufacturers of the time to bring their wildly varying software into line with the "Recommendations" being generated by the World Wide Web Consortium (or W3C). Standardizing on the specifications produced by the W3C injected a sense of consistency into Web authoring. Over time it became possible for Web designers to create a complex page in HTML and be assured that it would render reasonably consistently across many browsers and operating systems.

 

Figure 1. The Web Standards Project.

 

[View full size image]

 

 


Many of the specifications released by the W3C deal with advanced coding and architecture problems that the average Web designer will rarely need to worry about. Although, beginning with a standardized version of HTML in the mid 1990s, the W3C produced a series of specifications for code sent to the browser that attempted to solve the compatibility problems in an intelligent, usable, and accessible manner.

Note

The W3C is interested in advancing the state of the Web. Producing recommendations since 1996, they have sought to provide solutions to the wide variety of technological challenges the Web presents.

原创粉丝点击