Introduction to CSS

Cascading style sheets (CSS) were the World Wide Web Consortium's answer to the development, in the mid-1990s, of a number of presentational HTML elements that threatened to blur the distinction between the appearance of a document, i.e. what the document looks like, and its underlying structure and meaning.

Within little over a year of Netscape's introduction of the <font> tag in 1995, W3C had little option but to include the new tag in the HTML 3.2 specification, which was published as a W3C Recommendation in January 1997. However, they had already started work on CSS. The first W3C CSS Recommendation (CSS 1) was released in 1996, providing web authors with the means to separate the code that defined the appearance of a web page from the code that defined its content.

Unfortunately, it would be over three years before any of the major web browsers managed to implement the bulk of the CSS specification. As a consequence, the adoption of CSS by web authors was initially somewhat slow. Meanwhile CSS 2, essentially a superset of CSS 1, was released in 1988. The release was perhaps somewhat premature, since CSS 2 suffered from a number of errors and was consequently reformulated as CSS 2.1.

CSS 2.1 fixed the errors in the CSS 2 specification, removed some of the feature that were either poorly supported or not supported at all by web browsers, and added new features to bring the specification in line with extensions that had already been implemented by browser vendors. Even so, work would continue on the specification for a number of years, with CSS 2.1 finally being published as an official WC3 recommendation in 2011.

Meanwhile, in 1988, work had already begun on CSS 3. WC3 had obviously learned from their experiences with CSS 2 that there were no guarantees that browser vendors would adopt new CSS features. Even if they did, there could be a significant delay between the issuing of a draft specification and its adoption, and browser implementations would not necessarily adhere to the specification as written.

Unlike previous specifications, CSS 3 is not a single monolithic specification. It is published as a set of separate documents known as modules. Each module deals with a relatively small subset of the overall specification, and either adds new features or refines and extends existing features. All additions and enhancements to the specification are written in order to be backward-compatible with older versions of CSS.

The adoption of a modular approach to the standard means that parts of the specification that are considered to be relatively stable can be given Candidate Recommendation (CR) status. Although support for CSS is still not consistent between browser implementations, you can reasonably expect most browsers to support features defined in modules that have attained CR status.

The adoption of a modular approach has also led to modules being classified according to the CSS level to which they apply. For example, most modules currently being developed actively or maintained are specified as level 3, because they build on (level 2) features defined in the CSS 2.1 specification. Take note however that the designated level of a module does not necessarily equate to the WC3 recommendation to which it belongs (or will belong). For example, modules that implement completely new functionality are designated as level 1 modules.

Work has already begun on CSS level 4, with the same modular approach being adopted. Level 4 modules improve on, or extend the functionality of, features defined in level 3 modules. It is probable that this approach will continue for the foreseeable future. As new features emerge, they will be refined and re-defined over a period of time until they achieve CR status, at which point we should expect to see them implemented by the majority of web browsers.