Content, Structure, Presentation, and Behavior
August 5, 2004 – 8:07 amAs promised, I’ve continued to think about Jeremy’s post on the :hover pseudo-class, and I think I know why I’m not so concerned about it as he is.
As I see it, there are four atomic components to a web site: content, structure, presentation, and behavior. At various times and places, certain aspects of these components have been mixed in together - content and structure are both contained within (X)HTML documents, for instance, and the :hover and :active pseudo-classes in CSS bring behavior into a mostly presentational language. While it’s all well and good to strive for a complete separation between each of these components as Jeremy seems to advocate, many sites, I think, fall into an intermediate stage of modularization.
Imagine for a moment what a site would look like with all components completely separated - with the content in XML or in a database, the structure in XSLT or data access class, the presentation in CSS, and the behavior in DOM scripting. Very few sites (in my experience) actually attain this four-level modularity. Instead, I tend to see a two-level, molecular structure, in which content and structure appear together (as in an (X)HTML file) and presentation and behavior are lumped together. In the case of most sites (I’m excluding web applications here), it seems that the behavior component is in fact just an extension of the presentation component - it’s not something you’d necessarily want to maintain if you changed the rest of the presentation.
And this, in fact, brings me to the final point I wish to make. Even in cases in which it is necessary to separate behavior from presentation (in complex sites or applications), it can still be a good idea to keep some aspects of the behavior layer - namely :hover and its ilk - in the presentation component. If all you’re doing is changing a link color or highlighting a paragraph when a user rolls over it, then you really are specifying behavior as an extension of the presentation. In such a case, it’s perfectly fine to link the two.
OK, so I didn’t say I thought about it well. I just said I thought about it more. Sorry for any incoherence above.

