Web consortium publishes CSS2 draft

December 20, 1997

Seybold Report on Internet Publishing
Vol 2, No 4

Proposal includes multicolumn layout, improved table support

The World Wide Web Consortium (W3C) has released a public draft of cascading style sheets ( CSS ) 2, a standard for defining page layout properties for Web pages. The draft includes several extensions intended to make Web pages more suitable for printing, as well as to improve access to the visually impaired and to provide better online typography.

CSS1, which became an official W3C standard a year ago, provides a means of applying page layout properties, such as margins and typographical effects, to Web pages (for an introduction to CSS1, see The Seybold Report on Internet Publishing, Vol. 1, No. 10, pp. 3-12). An author can apply a style sheet to a single element or an entire page, or link a single style sheet to any number of pages. Because style sheets are defined independently of a document’s HTML markup, an author can apply multiple styles—for Web browsers, hand-held devices and printers, for example—to the same page without altering the document’s basic structure.

The CSS2 draft incorporates a number of proposals, some of which predate CSS1. The additions fall into several general categories, including support for absolute positioning, multicolumn layout and other print-specific properties, applying styles to tables, typographical enhancements and support for tools designed to assist sight-impaired users.

Absolute support. Support for absolute positioning is not a surprise; in fact, both Netscape and Microsoft already support this feature in their 4.0 browsers. Previously, an author who wanted to place text, images or other elements precisely on the page had to use a combination of tables and invisible single-pixel GIFs, with inconsistent and sometimes unfortunate results. Using CSS2, however, designers can simply specify the size of a box and its location on the page, much as they would in a traditional page-layout program. Users can also specify three-dimensional coordinates to place overlapping boxes on a page, and they can manipulate boxes using a scripting language such as JavaScript (though this is not an official part of CSS2). Positioning also has implications for print output, since it allows an author to specify a multicolumn layout for a print document even if the Web version uses a single-column layout.

Multiple-column layout is just one aspect of CSS2 that will make printing documents from the Web both easier and more aesthetically pleasing. The draft also includes support for page breaks, handling of widows and orphans, left and right page formatting, running headers and footers, and printed page margins. Printed documents will still depend to some extent on the user (as in the case of what to do with page boxes that don’t fit on a target sheet), but the proposal is an enormous improvement over the current state of affairs.

Styles for tables. CSS2 also allows authors to apply style properties to tables, a feature which didn’t make the cut for CSS1. The draft treats tables as multilayered objects, permitting fine control over each part of the table. An author can apply different styles to separate columns, rows or even cells in a table, including the ability to set alignments, positioning, colors and headers, as well as to manipulate the borders and padding around individual cells.

CSS2 cannot format unstructured table data on the fly—the author must place the data in a basic HTML table—but it does offer a wide range of presentation options. With XML likely to become a common method of exporting relational data into Web pages, table styles could prove useful as a way to control and automate the presentation of such data.

Look what’s talking. Screen readers, which convert text on a page to audio output, are already common among sight-impaired Internet users. CSS2 adds an extra dimension to this format, combining speech with audio "icons" and spatial properties to create a much richer, more interactive experience. An author, for example, may specify different "voices" to render different content, much as they might specify different fonts or typographical effects on a page. Spatial properties can convey a sense of being "surrounded" with a presentation, allowing an author to present a conversation with spatially distinct voices.

The aural properties may be the most easily overlooked aspect of CSS2, but they may also be one of the most lucrative in the long run. These properties will pave the way for a host of new applications, such as the ability to read a page of directions to a driver or to describe a set of mechanical specs for a mechanic or medical records for a surgeon. These applications could also generate an interesting synergy with speech synthesis and voice-recognition technologies, both of which are evolving at an accelerating rate.

Name that font. CSS1 allowed an author to specify fonts or font families in a style sheet, but the standard’s authors assumed that the end-user would have at least one of the target fonts installed on his or her system. CSS2 goes much further, providing several options for obtaining a font if it is not already on the end-user’s system. These include downloading the font or a substitute over the Web, matching the specified font with an existing substitute on the user’s system, or synthesizing a substitute font. To assist intelligent font matching and synthesis, CSS2 includes a number of optional values that specify a font’s vertical and horizontal stem widths, stroke angles, letter heights and other metrics, as well as a means of specifying a font’s Panose-1 classification code (used for matching TrueType fonts). The standard is compatible with both the Microsoft–Adobe OpenType and Bitstream TrueDoc technologies, and it leaves a great deal of room for various browsers and operating systems to implement their own typography solutions.

Implications. The CSS2 draft is technical reading, and it includes a number of other improvements besides the ones we’ve described above. (If you’re interested, go to TR/WD-CSS2/cover.html to see the complete draft.) Broadly speaking, however, it’s clear that CSS2 is a significant step forward, providing solutions to some of the biggest problems facing Web designers. For online page display, this means providing a way to lay out pages with pixel-level precision, without resorting to GIF-and-table hacks. This also means giving authors a way to style documents for a variety of formats, including print, online and audio, by creating a library of reusable style sheets and then simply linking HTML or XML pages to the appropriate styles.

After playing catch-up with Microsoft and Netscape for a couple of years, the W3C is now developing specifications during the vendors’ development cycle rather than after product releases. The upside is that Netscape and Microsoft now have a common, neutral target to shoot at with their next release.

The downside is that products that support CSS2 are not yet available. Most Web browsers can’t even handle CSS1, much less CSS2. Netscape’s Navigator 3.0 ignores style sheets, and Communicator 4.0 handles them badly, while Internet Explorer 3.0 includes only partial support for CSS1. Even so, browser-aware servers are readily available, and style sheets can help simplify the chore of keeping browser-specific page layouts. Using the two in combination is a practice that publishers can experiment with now, without requiring all of their visitors to upgrade their software.

Intranets are another promising location for adoption. Style sheets designed by professionals can be dispersed throughout an organization in conjunction with a specific browser, helping employees contribute to the intranet while still maintaining a consistent look to the pages.

As for browser support, there are some signs of progress. Both Communicator 4.0 and Internet Explorer 4.0 already implement the positioning syntax in CSS2, and by most accounts they do so quite well. Macromedia’s Dream- weaver authoring tool also supports the CSS2 positioning language (see The Seybold Report on Internet Publishing, Vol. 2, No. 3), and Dreamweaver and many other authoring tools either include CSS1 support or will do so shortly. Both Netscape and Microsoft are committed to adopt W3C standards in their products (even if they do so slowly and haphazardly), which means that style sheets will eventually find universal support. Finally, as Web design standards improve and online output options multiply, developers are going to have strong incentives to adopt style sheets as quickly and as aggressively as they can. Style sheets may not be the rule just yet, but they are definitely well on their way.