Bert Bos | CSS tutorial – CSS structure

CSS structure

CSS structure

CSS structure – features

CSS has many features. “Feature” isn't a technical term, but is has to do with things that can be tested: each keyword, each kind of selector, each type of value for a property, but also syntax features such as cascading and inheritance. The set of features is still growing, we don't know yet what CSS will eventually consist of.

CSS structure – levels

Originally we didn't intent CSS to be very big. It was to be a simple language that just about everybody could learn, that delivered good typography, but not necessarily complex layouts.

The current level 2 is close in size to what CSS was supposed to be, although we originally wanted something like (grid) layout templates instead of absolute positioning. That was still much too big for the browsers of the time, so we split it in two levels.

We eventually had to leave things out of level 2, too, and at the same time the implementers wanted more (although at a slower speed) and so we decided to add a level 3.

CSS structure – modules

CSS became very popular and professional users wanted us to extend it, rather than design a complementary language. (We did make XSLT and XSL-FO, and they are very successful with book publishers, but not with Web designers.) And so CSS level 3 soon became so big that we couldn't write it all in one specification. It would be too big and take too long.

So we decided to split CSS in modules. Eventually the whole of CSS should be defined by modules and the old level 1 and level 2 specifications will be obsolete.

After some modules were finished, we found that people wanted their features to be extended even more, and we decided that it was best to add a level 4, so that we didn't have to make even more modules, but could keep the same name. Thus, e.g., we have started a Backgrounds & Borders level 4 and a Selectors level 4.

CSS structure – 2007

But there are very many modules and in the Working Group we keep splitting and rearranging modules whenever one of its features turns out to be difficult and risks holding up the easier ones. Modules are thus primarily for the benefit of the Working Group, they are difficult to explain to users.

We decided that users needed something easier. We don't really have the resources to do much for authors (we hope other people will write documentation for them, e.g., via W3C's new WebPlatform.org), but we can do something for one class of users, viz., implementers. We decided to publish a “Snapshot” every once in a while to document the features that were ready to be implemented.

In principle, implementers can implement everything that is a Recommendation or a Candidate Recommendation, but for extra safety our snapshot includes only Candidate Recommendations with which we already had some experience, so that we know they are really stable.

CSS structure – 2010

So far we published two snapshots. Their names aren't very attractive, we know. We just called them after the years we wrote them: 2007 and 2010. Maybe we'll come up with something more catchy for the next one…

The 2010 snapshot differs from the 2007 one only by the inclusion of the Media Queries specification. Of the many drafts we published between 2007 and 2010, only that one was stable enough to be added.

The next snapshot may include one or more of the new Values and Units, Backgrounds and Borders, Multi-column, Image Values and Speech, depending on how we evaluate their stability. We haven't decided that yet.