Thursday, September 6, 2007

What Makes CSS So Great?

If there's one thing that characterizes what's gone awry with the Web, it's the proliferation of presentation at the expense of structure and content. Note that I don't say presentation is bad: there's nothing wrong with having a document look nice. The problem is that current presentation is achieved by perverting the structure with single-pixel GIFs, convoluted tables within tables, and semantically null constructs like the FONT tag. What were we thinking?

We were thinking about our audience, that's what. After all, if you're going to put information out there, it may as well look good. We all take pride in our work and want it to look as good as we think it is. Since HTML gave us very little in the way of interesting presentational abilities, we forced it into the channels we wanted to travel. If we'd had good styling to begin with, the corruption of the Web's underpinnings wouldn't have been necessary.

That's why CSS is so important. Finally, not only do we have the ability to describe sophisticated presentation, we can do it in relation to well-structured, uncluttered documents. No more tortured markup! Just clean elements that are attractively rendered through CSS.

That's the most fundamental -- if you like, the most pure -- reason to embrace CSS. In reality, this road to minor nerdvana has been blocked by implementation disasters. The earliest browsers to support CSS did so very badly. They gave CSS support its start, admittedly, but the behavior was so unreliable that nobody relied on it. And well they shouldn't have. The next round of browsers did better, but not really enough to gain widespread support.

Only recently has CSS become a viable component of the designer's toolbox. With Opera 3.6 and Internet Explorer 5, we saw nearly complete CSS1 support. IE5 for the Macintosh, especially, fulfilled this goal, with complete and correct support for everything in CSS1 except for blinking text (no great loss) and a few minor bugs in the float code. Opera 4 appears to have continued the work of earlier versions into most of CSS2, and Mozilla's recent builds have contained very good CSS2 support.

So if you've been holding out on CSS adoption, it's time to come in from the cold. Thanks to some impressive efforts on the parts of the big three browser vendors, you can learn to bask in the warmth of CSS without getting burned.

Read the rest at the O'Reilly Web DevCenter

No comments: