Jason Kottke has written a thoughtful piece on the difference between standards and semantics, and if you’re just learning this stuff by way of my site (heaven forbid) or some of the many others out there, it’s worth your time to read it and consider his points.
Let me start out by saying that Jason is absolutely correct. You are allowed to use
<font> tags in your valid XHTML. You are allowed to continue designing with tables. As long as you lowercase your tags and watch your nesting, there is nothing stopping you from building your XHTML sites without a lick of CSS.
But if this is all you’re doing, you are like the driver of the VW Beetle carefully pulling to a stop at the light, failing to move for the Mack truck barrelling toward him at 120km/h. Sure he’s following the letter of the law, but the light was put there for his safety. He’s completely missing the spirit in which it was written.
The W3C has a commitment to backwards compatibility. XHTML is meant to work back to 4.x and older browsers. (Which is debatable given the 2.0 issue, but please, let’s focus.) This requires a certain amount of support for deprecated elements. Tables will always be with us, because they were created for tabular data; you will be able to author table-based sites for years to come. But stay with me now, here’s where it gets tricky.
XHTML is a clean slate: it’s HTML, but it’s XML. It’s the best of both worlds, but it’s halfway between. HTML has a long and ugly history of visual hacks, proprietary extensions, and general abuse. The browsers that support it are lax, overly tolerant, and encourage sloppy coding. XML, on the other hand, is defined by a tight set of rules; it is structurally complex, rigidly demanding, and doesn’t offer any presentation cues whatsoever. It is completely reliant on external styling, and in this case that styling happens to be CSS.
The move from HTML to XML requires a huge shift in developer mindset. There are a lot of obstacles to overcome yet, not the least of which being solid browser support. We’ve only started down the road, and XHTML is how we’ll get there. Here’s the path, in 3 steps:
- XHTML allows for easy introduction to proper coding methods by weeding out bad techniques, while requiring no more than a simple change in syntax. Drop your tags’ case, watch your nesting, and close everything. Easy. The first step is one which most are willing to make because it requires the least.
- Once developers latch on to this, they will realize sooner or later that the next step is to move toward a separation of content and presentation. This is where most are stuck today, and until the baseline browser moves up a generation from 5 to 6 (or 7), there will generally be dissent and lack of cooperation. Some are aware of this step, some aren’t, but it’s the next big paradigm shift and it has already started happening en masse.
- After making the prior transition, the next step is full-on XML rendering, which is going to be a real doozy. Validating only your home page and allowing lax code on other less-prominent pages is a practice that will have to stop. What happens when the switch is flicked between HTML rendering (which, chances are, is how your site is being parsed right now) and XML is that if you have an error in your code, just the slightest little bug, your site won’t render at all. You will see a happy little error message, and that will be that until you fix it. Seems a bit harsh doesn’t it? Well, consider that programmers have been dealing with compile errors from sloppy code for decades; welcome to their world. Not only does your own code have to pass muster, but code from third parties and external sources must play ball too. This one will take years, folks.
Standards, as Jeffrey Zeldman notes in the highly recommended Designing With Web Standards, are a continuum. You’ve gotta get on the bus sooner or later, but once you do there are a lot of stops along the way. You’ve made the transition to XHTML? Great! How’s your separation of content and presentation coming along?
Don’t stop with the easy stuff, this is one rabbit hole that goes real deep.
You’ve got help along the way - hey, I’m just finding out about this stuff myself. I don’t have all the answers, but the more I read the further I go into Wonderland. There are a lot of very knowledgable authors publishing on the subject, and as long as you keep learning, sooner or later we’ll all get there.