The Evolution of Style Sheets | WebReference

The Evolution of Style Sheets

The Evolution of Style Sheets

by Alan Taylor (

Since the first caveman scratched a stick figure bison on a cave wall, designers have been using placement and style as tools to deliver information. As soon as the Internet exploded on the scene, placement and style in electronic media took a back seat to expedient information delivery. The Web made its splashy debut, and old-school designers were underwhelmed - HTML 1.0 had a very limited capability to control page elements, but it was a start. Print designers had been using computers for several years, and were comfortable within their environment. Adobe gave designers a gift in creating a device-independent "page-description language" in 1985 called PostScript. The Web uses HTML, a "markup language," that has no real facility for page description.

When the World Wide Web Consortium (W3C) formed in 1994, its mandate was the promotion and standardization of non-proprietary HTML and Web specifications. Standard style sheets to guide page layout were among the first items on that agenda. Developing a page style definition that lay outside of the content of the page, (HTML), would help designers and authors to have more flexibility and ease of control over presentation.

The print industry had established style sheet usage as a tool to control layout over various printed works across multiple platforms. As early as 1993, an employee of O'Reilly and Associates, Robert Raisch, sent out a request for comments on "'stylesheets' in HTML documents." Several proposals followed, with varying degrees of acceptance. In May of 1995, Bert Bos of the W3C wrote a charter to formulate the goals for a standard of style sheets, and to get the process moving. The ball began rolling faster with the publication of Håkon Lie's "Cascading HTML style sheets -- a proposal" through the W3C. The idea of 'cascading,' or ordered style sheets, solved a few early problems and lent even more flexibility to potential users. Håkon Lie went on to shepherd CSS standardization to its current popularity.

A stylesheet "cascades" when a browser has an established order of importance that it can apply to multiple stylesheets. For instance, an inline style declaration has a higher precedence than an externally linked stylesheet. The browser applies the style from whichever stylesheet has the highest precedence. The general order of precedence (from lowest to highest importance) is as follows:

In future browsers, the author won't be the only one able to specify stylesheeets, Readers will be able to specify how they want incoming pages to appear. Authors will still have the ability to override reader's stylesheets if they wish.


Current and Future CSS Support

Netscape 3.0 does not currently support CSS, and has issued announcements about support in Navigator 4.0 -- one of five core components of Netscape's Communicator Suite -- next year. According to Anh Nguyen, Netscape's Product Manager for Java and JavaScript, Navigator 4.0 will fully support CSS1. Netscape will introduce Javascript Style Sheets (JSSS), which Nguyen calls a superset of CSS1. JSSS is a mechanism for getting and setting CSS properties with Javascript, Netscape's own property-based scripting language. Details on the implementation of JSSS are now available on Netscape's developer site.

JSSS supports linked, embedded and inline style statements, like IE's CSS support, but apparently uses a different syntax. For example, JSSS style is of type "text/javascript," compared with IE's "text/css." In another example, to declare all <H1> tags as being "red" with a size of 12 points in a linked stylesheet, for Internet Explorer or Arena you would write:

     H1 {color: red;
     font-size: 12pt}

In JSSS, you would write:

     tags.h1.color = "red";
     tags.h1.fontSize = "12pt";

Netscape claims that the advantages to declaring page properties in a programmatic method like this allow for more flexibility, where authors could write programs to read and affect page layout. An example would be:

     if (color == "red")
       color = "green";
       fontstyle = "italic";

Microsoft is also issuing its own plan to mix scripting languages and CSS, called "Dynamic HTML," a large part of "Trident," which is in turn part of Microsoft's Active Desktop program. Dynamic HTML will allow authors to use VBscript or Javascript to access elements within a page using an "object model." This model breaks up all page elements into objects -- a single image is an object, the class of all H1 tags on page is an object -- and allows page alteration on the client side (readers can even cut and paste on their end.)

The difference between CSS1 and Netscape's JSSS or Microsoft's Dynamic HTML is the implementation of the languages. CSS is a declarative language, an extension of HTML. JSSS and Dynamic HTML use programming environments to create declarative page elements "on the fly," and are considered supersets of CSS1. The difference may look academic, but the future of WWW page design is at stake. Will the W3C prevail as the authority, and CSS remain a relatively simple declarative language? Or will Microsoft and Netscape create a hybrid of programming and markup, making the HTML object model the new Web paradigm? Microsoft and Netscape have both issued their proposals to the W3C, ("Trident" and "JSSS" respectively), and they have been taken into consideration under the Distributed Objects and Mobile Code activity section of the W3C.

Where will Cascading Style Sheets end up? Wait a month or two, and we should have a better handle on the future. But CSS is not likely to fade away as the latest BLINK tag, it's really only a question of who will determine how it is implemented -- and therefore how useful it will be.

Addendum (12-16-96): According to Chris Wilson of Microsoft, The project code-named "Trident" is now known as "Dynamic HTML", and "Trident" is no longer used as a name. He also suggests that Netscape has plans to release Navigator 4.0 with a core support for standard non-JSSS Cascading Style Sheets, the implementation of which is TBA. Microsoft's Cascading Style Sheets Object Model, (CSSOM), a method to give complete power of CSS to dynamic control, is currently being reviewed by the W3C.


Further Reading

Bert Bos' listing of historical SGML and HTML style proposals
A look back at several possible directions style sheets could have gone.
The official W3C proposed Recommendation for CSS1
The CSS Bible for all of fully supporting Internet Clients.
Steven Pemberton's W3C CSS quick Reference
An official source for authors in need of quick authoritative information.
Message index of the mailing list

Comments are welcome

Revised: October 13, 1999