Writing New Kinds of Web Pages
With the most recent version of the major browsers out, we’re finally on our way to a vendor-neutral, standards-based Web. Not all the way, mind you, but certainly a long way from the days when Web authors felt compelled to announce that their pages were "best viewed with your-browser-name-here."
Still, the Web suffers from a fundamental limitation: Every page is built for display on a computer screen. Anyone who has printed a Web page and seen the ugly transformation from screen to paper knows what I mean. But imagine your Web pages looking as good on the printed page as they do on the screen or being read to you. These once elusive goals are about to become possible through a concept called "media types."
Support for media types will be provided through an extension to the Cascading Style Sheets specification (CSS). CSS began as an attempt to reassert the distinction between the layout of pages and the content of pages. HTML was built to deliver content, but as the Web became popular, developers demanded more control over the way things looked.
CSS was invented to give developers the ability to build pages with consistent colors and formatting, precise positioning of content and other stylish features. The first attempt at building style sheets resulted in the specification known as "level 1," or CSS-1. CSS-1 is effective at managing the look and positioning of traditional HTML elements such as images, tables, paragraphs and headers.
Recently emerged from the standards process is the successor to CSS-1-- called Cascading Style Sheets level 2 (CSS-2). CSS-2 is a mammoth advance on the earlier standard -- the standards document is in excess of 330 pages -- and has many new features. Perhaps the most important is support for new media types.
CSS-2 defines styles for a variety of media, including TV, handheld computers, Braille and print. Knowing that developments in technology would make the standard obsolete, the developers made no attempt to provide an exhaustive list of media types. Instead, they listed some of the obvious ones.
One example is the print media type. Almost all Web pages flow continuously from top to bottom. That’s perfect for a computer outfitted with scroll bars and page-up and page-down keys. Printed output doesn't work like that, having properties such as page breaks, margins, headers and footers.
With CSS-2’s print media type, Web designers have the option of defining how a page looks when it is printed. A designer can specify how page breaks are handled and how much space to give to margins, as well as a wealth of other features that only make sense with a printed document. It’s even possible to give the first page of a document different formatting than all the subsequent ones.
If you think the level of control for the paged media type is impressive, what would you think if your pages were read to you? This idea is built into CSS-2’s "aural style sheet," which gives the Web author the ability to control how a page sounds when read. Sound crazy? It’s not.
Many Internet users have the text components of web pages read to them using a voice synthesizer. For pages with links or special embedded objects, audible cues are used to indicate different text properties. Unfortunately the result is still a dull, flat reading of the on screen text.
That’s the idea behind aural style sheets. They allow the Web author to build a variety of voices and sounds for each element on the page. For instance, each header could be preceded by a chime and read with a deep voice, while the body text of each paragraph could be read with a completely different inflection.
You may be tempted to think of aural style sheets as a cute idea destined for a small niche on the Web. On the other hand, there are many places the Web could reach if its content was listened to instead of read: in-car presentations, medical and industrial documentation and training systems and situations where the Web user had difficulty reading.
Until CSS-2, Web authors had to be content designing for computer screens. Once CSS-2 gets widely deployed, the Web will support TV and handheld devices and will even help build sites that can be browsed while driving in your car. For some of us it will be, for the first time, a pleasure to deal with media types. --Mark McFadden is a consultant and is communications director for the Commercial Internet eXchange (Washington). Contact him at firstname.lastname@example.org.