Designing a site in XHTML/CSS is elegant and good according to many of those who preach web design.
But there is a problem: CSS itself is badly designed, not just at the detail level, but in its overall concept.
Essentially, CSS is inside out – you don’t want to flow style into content, but to flow content into style (a template). Any blogger or developer of a database driven site knows this.
But what about structure? No matter how hard you try to put all of your style and structure into CSS you still end up with some style in an XHTML document. Style and structure are not mutually exclusive, which is why HTML table elements just won’t die.
CSS is based on a broken metaphor one which separates style, structure and content. People have naturally gravitated towards separating style from content through template based web design and there is no need for a third component of a complexity to be enforced. CSS is only useful to remove redundancy in styles used over and over, but that can be handled in other ways.
What would I do about it? Well:
1. Make CSS instructions HTML tags – it’s completely mad that CSS isn’t a tagged language.
2. Allow anything with a div or a span tag to reference an individual component of an tagged CSS template, anywhere on the web (i.e. a tag can reference another tag from a template anywhere in the world). This way you could style pages by referencing individual styles from other sites.
3. Allow div and span tags to be treated like triples, allowing them to be restyled on the fly by referencing div/span and permalink associated with div/span. This would make it easier for others to restyle your pages on the fly – for use in mobile devices etc. You can do this currently, but it sucks.
4. Make attributes have closing tags i.e. div class=x has equivalent closing tags (at the moment you have to put empty ‘class’ closing tags). This way you would be able to read XHTML and understand what the hell is going on. Web design kicked off originally because HTML was easy to view and understand, despite its flaws.