On the weakness of CSS

posted 06 March 2005

The CSS Zen Garden is intended to be an example of the power and flexibility of style sheets as a design tool, and a demonstration that the goals of CSS can be achieved, namely the separation of content from presentational code, while still producing attractive results. And largely, it achieves this: the layouts on CZG are varied and frequently beautiful. But on another level, it is also a demonstration of CSS's weaknesses as well.

For example, look at the content boxes on Planet Seldo. They have visual elements around their borders, that stretch to fit the size of the box, both vertically and (if you resize your window) horizontally. This is known as a "stretchy" layout, and it is generally considered a desirable thing in web design because everybody's screens are different sizes and people can change their window size at will. The stretchyness is achieved by a little CSS trick of defining a background image for the content box (a DIV tag) that is quite large: only the part that fits within the size of the box is displayed.

Unfortunately, this means there is no way to define stretchy elements for all four sides of a div if that div is all you have, because a div can have only one background image. Thus, you have to attach the background images to other elements, e.g. the header tag at the top, or in the case of PS, the date at the bottom of each entry, or both. CZG does this as well: the layout is full of empty divs called "extraDiv1", "extraDiv2", etc..

There's no reason that should be the case. It's just a weakness in the design of CSS. You shouldn't have to add extra elements to your (semantic) HTML in order to produce a (presentational) CSS effect. And this reliance on extra elements has nasty side-effects.

One of them is caused by the fact that the extra elements don't automatically end up being the same size as the containing element. So designers get around this by manually setting both the container and the contained element to the same width. As a result, the layouts lose their "stretchiness": practically all the CSS Zen garden designs (except, it must be pointed out, the very first one) are designed with fixed-width layouts.

All of which is disappointing, and shows that web technology still has some way to go before it can be considered a mature medium for graphic design.

tagged with
1 comment

On London

posted 06 March 2005

Blog happy today! Making up for recent dearth of posting... I was having a conversation with someone online today, and he posed this question:

I'm trying to decide whether to move to York or London. York is cheap and near my parents (my dad is not well and I'd like to make the most of the time he's got). London has got everything a person could possibly want. Or has it? You say that it's great if you're young and single (and confident, good looking, etc.) but what if, er, you're not all of those things? I have this fantasy of moving to London and having this incredibly gay life (whatever that means) but is it just a fantasy?

This was my response:

It's quite a serious question, so I'll give you a serious answer.

I am, in general, a huge cheerleader for London and have been partly responsible for persuading several of my friends to move here, a virtuous circle since the more friends who are here, the more I enjoy London, and the better life becomes to boast about so we can invite yet more people.

What I actually said is that London is good if you're young and single, but actually the key word there is single, I think. London is full of fun things to do and millions of new people to meet and it's a great place to set about building a social life: what it's not so good for is settling down, starting a family, et cet era, all of which are misty milestones ahead on the roadmap of my life. If what you want to do is spend a lot of time with groups of friends and meet new people (and spend a LOT of money doing so), London is the place to be. If what you want to do is get to know just one person very well and get on with your life, anywhere else is probably a better bet: London is just too distracting, too busy. It all depends on your goals, and what stage of life you're at.

As for all those flattering adjectives you threw my way: confidence always helps when meeting new people, but confidence is just the past tense of bravery. Young and good-looking are extremely relative terms: London is full of people of every age, but I've found age is much less important than common interests and general compatability in forging friendships.

Finally, the matter of the "incredibly gay life": it's a phrase that sets off warning bells in my head in terms of what your expectations might be. London certainly has the capacity to give you an amazing life, and aspects of that life can involve being gay. But if what you're seeking is some mystical playground of clubs, drugs and disco music, with sex-starved nubile 19-year-olds throwing themselves all over you, you will find yourself as disappointed as I was to discover they don't exist :-)

One's world is always defined by your friends, not just the people around you: coming to London for the first time can be a very lonely experience, even while crowded on every side by people. Just like any other place, it takes time and effort (and in London, money) to meet people, form friendships, and accumulate a social circle, which is when the fun kicks in. If you're willing to make the effort, London is amazing, but if you're willing to make the effort so can be practically any place. London is a lot bigger, so the pool of options is deeper and wider. But it's not a fundamentally different type of pool.

tagged with
0 comment