Cascading Style Sheets

Cascading Style Sheets, fondly referred to as CSS, is a simple design language intended to simplify the process of making web pages presentable. Put simply, CSS handles the look and feel part of a web page.

With CSS, you can control the color of the text, the style of fonts, the spacing between paragraphs, how columns are sized and laid out, what background images or colors are used, as well as a variety of other effects.

CSS was created in language that is easy to learn and understand, but it provides powerful control over the presentation of a document. Most commonly, CSS is combined with the markup languages HTML or XHTML.

These markup languages contain the actual text you see in a web page—the paragraphs, headings, lists, and tables—and are the glue of a web document. They contain the web page’s data, as well as the CSS document that contains information about what the web page should look like.

HTML and XHTML are very similar languages. In fact, for the majority of documents today, they are pretty much identical, although XHTML has some stricter requirements about the type of syntax used.

Creating the underlying theory and planning how Cascading Style Sheets should function and work in a browser are tasks of an independent organization called the World Wide Web Consortium, or W3C. The W3C is a group that makes recommendations about how the Internet works and how it should evolve.

The W3C is comprised of member companies and organizations that come together to create agreedupon standards for how the web should function. Many prominent companies and organizations are W3C members, including Microsoft, Adobe, The Mozilla Foundation, Apple, and IBM.

The W3C oversees the planning of several web languages, including CSS, HTML, XHTML, and XML, all of which are mentioned in this book. CSS is maintained through a group of people within the W3C called the CSS Working Group.

The CSS Working Group creates documents called specifications. When a specification has been discussed and officially ratified by W3C members, it becomes a recommendation. These ratified specifications are called recommendations because the W3C has no control over the actual implementation of the language.

Independent companies and organizations create that software. The specifications created by the W3C are not limited only to web browsers; in fact, the specifications can be used in a myriad of software types, including word processor and spreadsheet applications, as well as by different types of devices, such as PDAs and cell phones.

For that reason, the software implementing a specification is referred to by the W3C as the user agent, which is a generic term that encompasses all the different types of software that implement W3C specifications.

The W3C merely recommends that a language be implemented in a certain way to ensure that the language does what is intended no matter which operating system, browser, or other type of software is being used.

The goal of this standardization is to enable someone using the Netscape browser, for example, to have the same Internet experience as someone using Internet Explorer. Common community standards provide web site developers with the tools they need to reach an audience, regardless of the platform the audience is using.

As I write this, CSS comes in four different versions, each newer version building on the work of the last. The first version is called CSS level 1 and became a W3C recommendation in 1996. The second version, CSS level 2, became a W3C recommendation in 1998.

The third version, CSS level 2.1, is currently a candidate recommendation. A candidate recommendation is the status the W3C applies to a specification when it feels the specification is complete and ready to be implemented and tested.

After the specification has been implemented and tested by at least a few of the member companies, the candidate recommendation can become a full recommendation. The fourth version is called CSS level 3 and portions of it are still in development.

You can find the W3C website at Go there to find documents that browser makers refer to when they are looking to implement languages such as CSS into a browser or program. Be advised, these specifications lean heavily toward the technical side.

They aren’t intended as documentation for people who use CSS; rather, they are aimed at those who write programs that interpret CSS. Now that you know a little about who is responsible for planning and outlining the development of CSS, the next section describes how a web document makes its way into your browser.