Maximum Aardvark

« Growing Pains | More About Writing »

Semanticity

There's a fresh article on A List Apart called Flexible Layouts with CSS positioning. It's well-written, and has good intentions (setting up a standard for cross-browser layout design where separate browsers each think the others are wrong). Unfortunately, it throws out the concept of the Semantic Web.

The author's suggestion is to layout all XHTML within div tags with id attributes such as top-section, top-col-1, mid-section, mid-col-1, mid-col-2, etc. What this does is cast the layout of the page from the stylesheet, where it belongs, to the XHTML document itself, which should contain only semantic descriptions of the data that it contains.

Take this site for example. I don't claim to be an expert on the Semantic Web, but I do understand its importance and I strive to live as close to the ideal as I can. The div id on this page include header, blogroll, sitenav, calendar, and content (to name a few). What's beautiful about this approach is that I can modify my stylesheet to place these blocks anywhere I want, without having to touch the source of my XHTML document, while still having the descriptors in the id attributes make sense. Say I decide to put my blogroll back under the site navigation, as it once was. Modify a few lines of my stylesheet and it's done. No need to even look at the XHTML source.

Granted, it's not a perfect system. There are still shortcomings of positioning that need to be grappled with, but for the most part, all layout information can safely be stored in the stylesheet. I just feel that the Semantic Web is a good deal more important than pixel-perfect design (which is a pipe dream anyway on the Web, but that's a whole nother argument).