o2team/H5Skills

CSS的版本

Opened this issue · 0 comments

版本号

W3C明确表示,CSS没有版本只能等级(level)。

Cascading Style Sheets does not have versions in the traditional sense; instead it has levels. Each level of CSS builds on the previous, refining definitions and adding features. The feature set of each higher level is a superset of any lower level, and the behavior allowed for a given feature in a higher level is a subset of that allowed in the lower levels. A user agent conforming to a higher level of CSS is thus also conformant to all lower levels.

上文摘录自:https://www.w3.org/TR/2015/NOTE-css-2015-20151013/#css-levels

通常称呼 css版本 由level+revision(级别和修订号) 组合而来。例如:css 2.1,2是level号,1是修订号,表示是css2的第一个修订版本。
也就是说 1.0, 2.0 类似这样的版本号是不存在的,因为不可能有第0个修订版本。

css 1

css 1 只有一个版本: https://www.w3.org/TR/CSS1/

css第一个规范的地址:https://www.w3.org/TR/REC-CSS1-961217.html 很有意思,表格完全没有图片,像是dos时代的产品

css 2

css 2 目前有三个版本:css 2, css2.1, css2.2(css2.2是2016.04.12才出的修订版)

css 2.1 是 css 2的衍生版。

CSS 2.1 is derived from and is intended to replace CSS2.

来自:Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification

*注:css 2.2是level 2最新修订片,所以现在的主流是 2.1,关于 css 2.2 的介绍查看:https://www.w3.org/TR/CSS22/ *

css 3

css 3 只有一个版本:css 3。从css 3开始,css工作组开始引用模块化的管理方式,如下:

CSS Level 3 builds on CSS Level 2 module by module, using the CSS2.1 specification as its core. Each module adds functionality and/or replaces part of the CSS2.1 specification. The CSS Working Group intends that the new CSS modules will not contradict the CSS2.1 specification: only that they will add functionality and refine definitions. As each module is completed, it will be plugged in to the existing system of CSS2.1 plus previously-completed modules.

From this level on modules are levelled independently: for example Selectors Level 4 may well be completed before CSS Line Module Level 3. Modules with no CSS Level 2 equivalent start at Level 1; modules that update features that existed in CSS Level 2 start at Level 3.

文章摘录自:https://www.w3.org/TR/2015/NOTE-css-2015-20151013/#css

大意是:css 3的规范以独立的模块的形式存在,规范的修订以增量的存在(而不是以修订版的形式发布,潜台词是 css 3以后不会有修订版,即css 3.x永远不会存在)。

《css 快照2015》(即当前最新的css官方文档)的介绍里直白地说明了这点:

When the first CSS specification was published, all of CSS was contained in one document that defined CSS Level 1. CSS Level 2 was defined also by a single, multi-chapter document. However for CSS beyond Level 2, the CSS Working Group chose to adopt a modular approach, where each module defines a part of CSS, rather than to define a single monolithic specification. This breaks the specification into more manageable chunks and allows more immediate, incremental improvement to CSS.

css4

CSS Level 4 and beyond There is no CSS Level 4. Independent modules can reach level 4 or beyond, but CSS the language no longer has levels. ("CSS Level 3" as a term is used only to differentiate it from the previous monolithic versions.)

上文摘录自:CSS Snapshot 2015

css的级别有且只有三个 css1, css2, css3。现在或以后都不可能有css4,CSS 3做为专用术语用于与之前的版本做区别。