Introduction Obtain the latest version of the project Contribute to the project
A roadsign symbolizing the options faced when using CSS to create documents with separate content and style, while maintaining semantics.

The Classroom306 Generic Stylesheet Project

The Classroom306 Generic Stylesheet Project is an open source initiative to maintain a standardized stylesheet for all websites, helping facilitate the movement towards complete semantics on the web. For anyone who publishes content online, the Generic Stylesheet is a useful addition to webpages. It offers CSS styles that can be applied to the HTML of a page in common scenarios, prior to applying the more specific styles used to create the look and feel of the page. These scenarios have been identified through the open source process as cases where the intended format and the styles used to accomplish it should never change. Most importantly, the style rules in the Stylesheet are designed to ensure the markup of the page follows best practices regarding semantics.

Consider the following example. On your website, you want to display the names of several items, with a passage of one or more sentences beneath each one, describing some aspect of it. You'd like the entire passage indented on the left, so as to be visually separate from the item name. You've heard about how all web content should be written in a way that accounts for the semantics of the markup, to reflect the future of the internet. So you are reluctant when the thought occurs to you that you could just make the item names anonymous text, then wrap each of the descriptions in a div or p element of a special class that creates the indent. The fact that you're placing these items one after the other means that they form a list, and the element used to represent them should indicate that. You look through the Classroom306 Generic Stylesheet specification, a directory of all style techniques that the Generic Stylesheet has available, and see that there is a class for an unordered list (ul) and a style rule for a list item (li) that together implement the behaviour you are seeking. The class is called ul.withExplanations, and list items within lists of this class have all content beyond the first line indented. By using these elements, your markup will actually indicate that it is a list being represented. So you add a simple line to the head of your HTML document pointing to an external stylesheet with the URL of the Generic Stylesheet, and the style rules are available for you to use. You may still create other stylesheets for your page with styles that are specific to your site.

In addition to using the proper HTML elements for the job, the Generic Stylesheet ensured quality code: the withExplanations class is meaningfully named. Other factors are also taken into account to ensure the Generic Stylesheet's style rules are the best way to accomplish a desired effect, such as whether or not there are common industry practices used for this (and how important that is, weighed against other influences). The open source community that maintains the Generic Stylesheet has looked into all this for you, and provided a standard way of achieving what you desire. By using the technique recommended and encouraging others to do so, you can help create a web with standardized, recognizable components in the markup of pages from all sources.

A new data format

In the example above, the desired effect is not related to the specific look-and-feel of the page. It is simply a common structure seen in documents, that was desired to help communicate information to the reader. Modern theories of the separation of content and presentation are based on the idea that the markup document can contain the content, and only the content, in its entirety - such that the full meaning of the content could be communicated using only the markup document. But as the above example shows, there are certain techniques used in communicating ideas that HTML is incapable of representing. For such cases, CSS rules may be used to complement HTML. The Generic Stylesheet is founded on the idea that, in addition to the separation of markup and style rules, a further division can be made within the set of style rules, between those that exist to complement HTML in forming a fully expressive markup language, and those that are used for application-specific presentational details. It seems that in any document, the styles used only to complement the semantics of the HTML could be extracted and, combined with the HTML itself, form a truly stripped-down version of the document that could be inserted in any setting. This is the bare format that HTML alone is often believed to be. It is documents at this level that the Generic Stylesheet is meant for, and the style rules it offers are exclusively from that category of styles that are used to complement HTML's expressiveness.

With the long-term goal of exhaustively cataloguing the style rules and conventions needed for this format, the Classroom306 Generic Stylesheet Project aims to define and standardize the format.

For those wanting to contribute

What the Classroom306 Generic Stylesheet Project is and is not:

The ultimate goal of implementing semantics on the web is for the elements of the markup to be of types that actually represent the objects, subjects, propositions, etc. being communicated. This is the intention of the new frameworks and languages being created as part of the "semantic web", including RDF, XML and OWL. It will be some time before these technologies are in widespread use, but in the meantime it is recommended that the development world do what we can to implement semantics in HTML, the existing markup language.

The example cited earlier on this page illustrated an attempt to use meaningful types of element (ul and li) to markup the information. The element in question had to describe a structure of human communication (a list). This is distinct from the idea being communicated in itself (the items being listed). There are efforts, like microformats, to create HTML extensions to allow an abstract idea to be semantically represented in HTML markup. But the Classroom306 Generic Stylesheet Project is concerned only with allowing representation of the first type of idea - a structure used by humans to convey ideas of the second type.

Making changes/additions

The Generic Stylesheet is designated as an official "release" whenever it is deemed appropriate to do so - normally after a sufficiently long time period for significant changes to have been made. Official releases are posted on this web site.

Despite the name of the Classroom306 Generic Stylesheet Project, the stylesheet itself is only one component of the project and should only be viewed by us, the open source contributors who maintain it. The Generic Stylesheet as a whole is in fact a standard for web content that establishes a list of techniques for the best practice approach to common scenarios that was described earlier. This list forms the Generic Stylesheet specification, which is the only part of the Project that should be viewed by users. Each technique listed is a description of a scenario and the solution it offers, plus a reference to any styles used in the stylesheet itself to implement the technique. Note that some techniques may be only a description of a proposed standard solution, with no actual code. An example of this is technique number 11 in version 1, which simply states that the dfn element should be used to mark up the first appearance of a technical term in a document, as opposed to any other possible elements.

If a user finds a technique in the specification that offers the solution needed, and if it contains code, the user then applies the stylesheet itself to their document as an external stylesheet, using the URL of the stylesheet on this website.

Only one file is needed for each of these parts, so a release of the Generic Stylesheet contains only two files. Sourceforge is used to store all files used for ongoing work on the Stylesheet. Contributors need only make changes to the specification, not the stylesheet itself. All techniques that were part of the last official release are numbered. To allow multiple contributors to work concurrently on the specification, new techniques that are added should not be given numbers. Each contributor uploads his or her own copy of the specification file with the changes they made. When a new release is created, a version of the specification will be made by the administrator, by combining selected techniques from the files uploaded by all contributors into one file and giving the techniques unique numbers. The stylesheet itself will then also be updated.

The file for the specification is in HTML format. Instructions are included in a comment within the file, on how to format the list of techniques that make up the specification.

The Sourceforge page for the project is http://sourceforge.net/projects/genericstyle/.