CSS Issues

I’m currently working on converting the raww.org theme to proper XHTML/CSS. In theory this should speed things up considerably as it will remove the tables which can slow things down. In practice it will probably break the site on all browsers except Firefox (as I’m using that for development). It’s coming along nicely, with the basic design looking OK, but still requiring quite a bit of tweaking. I may well upload it later somewhere for people to look at and laugh. But while working on it I’ve reminded myself of a failing of the whole CSS concept, as I understand it.
The aim of CSS is to allow the content to be seperated from the design. This is all very well for simple designs, but take a look at some of the cleverer CSS tutorial/show-off sites. In order to do things which are, IMO, entirely design-related you need to include design information within the content. This defeats the purpose of CSS, surely?
As an example, let’s say you want a certain style of text (a user message, for example) to have a border. Simple, you define a CSS style along the lines of:

.usermessage {border: 2px solid black;}

… and in your HTML you create your block with:

<div align="left" class="usermessage">Some text here.</div>

That makes sense. The content states “this is a user message”, and the style knows how to handle it. But what if, during your design, you decide that the user message should have a graphical border. It’s a purely design decision, there should be no need to alter the content. But there is. The content would need to be wrapped up in additional orĀ  tags, something like (but not exactly):

<div class="usermessage">
<div class="um_top_border"></div>
...
<div class="um_bottom_border"></div>
</div>

Well, you get the idea – the stylesheet will need to be altered of course, but importantly, so does the content. The whole paradigm of seperating content and design falls over, as you need to make design decisions where they shouldn’t be needed. To write your content with full potential for a variety of designs, you need to include a multitude of additional, design-related tags that may or may not be used depending on the styles set.
Now I’ve not looked at CSS3, which is viewable over at the w3c website, and maybe it fixes the problems that I see in the current version. Indeed, there are hacks ways around the problem (you can set textual elements to be hidden, and replace them in the stylesheet with images, for example, but that’s no good for generated content). It’s just something that’s annoying me a little.
Hmm. I’ll wait for people to flame me now, saying I don’t know what I’m talking about. It’s probably true.

Post a Comment

Your email is never shared. Required fields are marked *

*
*