On standards and semantics
Reaction and response to Kottke’s original post on the confusion surrounding web standards, semantically rich markup, and the relationship between the two.
Jason Kottke wrote a post tonight about the general confusion surrounding web standards, semantically rich markup, and the relationship between the two.
Jason makes some valid points in his post. In particular, I agree that the idea of “standards-compliance” often borders on religious zealotry. Sought for no other reason than to attain a simple badge which supposedly “validates” the effort taken to get there. It’s as if some designers/developers strive to follow all the rules just to see those magic words when they get to the pearly gates: “Well done thou good and faithful coder. This page is valid ____!“
As a community, we’ve placed too much emphasis on the “valid” part of standards-compliant design. Some may even claim I did so just yesterday when I pointed out a few small errors on Macromedia’s pages as I closed out the entry. (It wasn’t intended as such, but rather, to quell naysayers about any “lack of compliance” based only on minor technicalities.)
As designers, we’ve danced around the idea of “semantics”, because we know the reality of browser support for CSS. We’re not willing to sacrifice all form for the sake of semantic purity. We don’t live in a world of perfect CSS support in all browsers yet. This means we insert plenty of generic divs or spans as hooks to add style to our pages. I think I can speak for everyone on Jason’s list in saying we’ve all made huge efforts to improve the semantic quality of our sites and those we design for our own companies and clients. But I know semantic purists could pin me to the mat if they picked apart the markup I’ve produced.
Where we succeed in achieving standards-compliance and semantic richness at the same time, we could certainly do a better job of highlighting the structure of our markup and why certain elements were chosen over others. But in doing so, we need to be prepared for the criticism that comes from those who expect absolutism. Once we start pointing out how we’ve made portions of our pages more meaningful, the portions which aren’t will get ripped apart. I’ve witnessed debates on semantics — they’re often endless spirals, leading tortuously to black holes of confusion and disagreement.
A prevailing concept in Jason’s post is something I couldn’t easily accept at face value:
[…] what I feel like is being implied in the effort to get more people to embrace standards compliancy is that coding a page in valid XHTML with valid CSS involves improving the semantic meaning of the content…which is just not true.
It is true that developers can potentially produce valid XHTML/CSS pages which end up semantically equivalent to a pile of junk. But it seems Jason is trying to separate web standards and semantics too far apart:
Coding web documents in valid XHTML doesn’t make them semantically useful nor does coding semantically correct documents mean the documents are standards-compliant
As developers learn and begin to work in XHTML and CSS, I believe they do often begin to automatically generate more meaningful markup. As the power of CSS unfolds, developers realize they can actually use numbered headings (<hn>
) as heads and subheads, and gain even more control over them using CSS than using the old table and a few font/bold tags to affect style. Also notice how lists (ordered, unordered, and definition) are being used much more often in XHTML/CSS sites, as opposed to the old way of generating groups of items:
item<br>
item<br>
item<br>
or even:
<div>item</div>
<div>item</div>
<div>item</div>
I believe we’ve seen big improvements in semantics as XHTML and CSS have grown in popularity. Granted, semantic richness isn’t always the first direction people go when they start learning XHTML/CSS. However, it’s a fairly natural tendency for someone to discover what it means to use more meaningful markup as it gets stripped down to the basics. A page full of nothing more than divs, spans, and br’s might be perfectly compliant in its use of standards. But generic markup like this will appear anemic in comparison to well-structured documents. It’s a learning curve which comes in small bits and pieces at first, but then rapidly accelerates as familiarity with the potential increases.
There’s a challenge in the last sentence of Jason’s post which should not go unheard. We do need to demonstrate more often how standards-compliance and semantics work together. And why one without the other won’t get us much further than where we’ve been in the not-so-distant past.