magazine resources subscribe about advertising




 CD Home < Web Review < 2000 < Sep 08  

Tag of the Week

CSS Evolution

By Chuck Musciano

About a year ago, we engaged in an in-depth assessment of Cascading Style Sheets. The CSS standard defines a simple syntax and a number of properties that give Web authors unprecedented control over how their documents are displayed to the visitor. Like everything else on the Web, however, CSS has not stood still. While we've been off learning other things, CSS has evolved into CSS2, adding all sorts of new features and capabilities to the initial CSS (now known as CSS1) standard.

A Popular Standard

The Cascading Style Sheets standard is perhaps unique among the many World Wide Web Consortium standards in that it is popular, easily understood, and has moved quickly into wide acceptance. Unlike XML, which is slowly gaining acceptance, and XHTML, which may never really get off the ground, CSS was welcomed with a sigh of relief by Web authors everywhere. Most CSS features were quickly rolled into the popular browsers, and each successive browser release offers more CSS support.

Given the popularity of CSS, it was only natural for the W3C to immediately begin adding to the initial CSS model. Once authors came to appreciate the power and simplicity of CSS styles, they began clamoring for new features and additional capabilities. Thus CSS2 was born.

CSS2 is in its infancy, but is destined for widespread acceptance. Like XHTML, many of its features aren't yet implemented in the popular browsers. The smart HTML author, however, would do well to learn what is coming in CSS2 so that all these new bells and whistles can be put to good use when they arrive.

CSS2 Briefly

In the coming weeks, we'll cover all the new features of CSS2, showing how they build on CSS1. Much like our coverage of XHTML, we'll focus on what is new and different, so that you can understand how to integrate these new CSS2 features into your documents. To whet you appetite, here are some of the new features you'll find in CSS2:

  • Printing support. Hallelujah! Perhaps the single most-lacking feature in HTML, print management is now available in CSS2. You can define page layouts, determine page breaks, manage widows and orphans, and more.
  • Media support. Minimally supported in CSS1, CSS2 offers broad support to create styles that work on a variety of display devices and media types, allowing your pages to be correctly viewed on almost any device.
  • Positioning control. CSS2 provides both absolute and relative positioning of HTML elements, giving you the ability to precisely place elements anywhere in your documents.
  • Font selection. CSS2 introduces smarter font matching and downloadable fonts, along with better control over font-size adjustments.
  • Content generation. Need custom content at the start of every paragraph? CSS2 makes it possible, with author-controlled counters, dynamic content, and list numbering.
  • Advanced selectors. Going beyond nested elements and contextual selectors, CSS2 supports child- and adjacency-related selection of elements.
  • And more! It may not slice and dice, but CSS2 can generate drop shadows, detect hovering mice, and manage system colors and cursors.

All of these features represent significant new capabilities that will soon be available to Web authors. Over the next several weeks, we'll cover each new feature in depth, ensuring that you'll be prepared for everything coming your way in the world of style sheets (at least until CSS3 comes along!). Join us next week as we start out with new CSS2 element selectors.

Chuck is the author of the best-selling HTML: The Definitive Guide and now, the fourth and expanded edition, HTML & XHTML: The Definitive Guide. He also writes on a variety of Internet and Web-related topics for a number of online magazines.

Of related interest: See the Web Review Style Guide, edited by Eric Meyer.

Copyright © 2003 CMP Media LLC