View Single Post
Old Oct 22nd, 2007, 6:01 PM   #27
Dameon
Troll
 
Dameon's Avatar
 
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4 Dameon is on a distinguished road
Re: Why is CSS such a mess?

Quote:
Originally Posted by cscgal
What I disagree with is the OP in this thread who (from the way I read it) is in favor of mixing content with design.
Quite the opposite. My point is that CSS makes doing so near impossible.

Quote:
Originally Posted by cscgal
In other words, what I mean by separating content from design is that the designer should never have to edit the content to make the final product look exactly the way they want.
That holds true only in an example as simple as the one given. That's my point. To be clear, for the purposes of my argument, I define 'content' as including its structure, XHTML tags in your example. When you add a div tag for the sole purpose of aesthetics, one which is otherwise unrelated to the content, CSS has failed. The same goes for reordering elements so things float around correctly or are otherwise easier to arrange. We are both well aware that this is often the case.

I use XSLT to get somewhat closer to the ideal. The page content will consist of tags such as <page> (perhaps with a 'name' attribute), <section>, <menu>, and <userinfo>. The structure of the source document could match up with the resulting XHTML doctree, but this is not a requirement. I may have a sidebar <div> with contents pulled from a separate document, using an XPath expression such as document('/navmenu.xml')/menu. The menu tag would have an associated template that would result in a <ul> element, but each menu item could just as well have additional attributes. The menu may expand only to show the parent items of the current /page/@name. Should this item be displayed only when the user is logged in? Check /page/user/@loginstate. Perhaps you want to arrange books by author, but the data is unordered. XHTML and CSS will come in to play at some point, yes. Combined, they are barely sufficient for page design -- at least this way, all of the XHTML and CSS hacks needed to make things pretty are entirely separate from what ever data source the content is coming from. Just give the client potentially useful information such that it can be processed appropriately. Not some prettified page/data bastard child.

Which was only my last point. Idealistic notions of clean design aside, CSS still comes in to play for layout at some point even in my above example. Surely there exists a better way to define page layout. My suggestion in the original post, close to human perceptions and way of thinking about layout it may be, is only one example.
__________________
MD5(sig) = bcef75433db02e9ad9bf81d6f7c5c270
Dameon is offline   Reply With Quote