CSS rant

CSS is great, but it’s too hard. When even the guy who wrote the books on CSS admits that it has “made the veins in my forehead throb”, you know there’s a problem.

All the stuff I’ve done on the web for the past year or so has been in CSS, and I’ve been gradually re-working older stuff to bring it into the new millennium. So I’ve drunk the kool-aid.

One thing that would make it at least a little easier would be a hierarchy to stylesheet documents. I’m not talking about the cascade effect (which is really neat). I’m talking about a way to organize a single stylesheet document.

As it is, there’s no enforced, preferred, suggested, inherent, or obvious way to structure a CSS document. You’ve just got “selector soup.” This makes a complicated stylesheet hard to read and hard to write. CSS offers contextual selectors, which would be an obvious candidate for hierarchical organization. Rather than having

div#main {margin:2px;}
div#main h2 {color:red;}
div#main h3 {color:blue;}

It would seem eminently sensible to have

div#main {margin:2px;} [
    h2 {color:red;}
    h3 {color:blue;}
    ]

or something like that.

With a structure like this, it would be possible to distill an HTML document down to its tags, and generate a structured list of selectors, to create a stylesheet skeleton.

The other bear, for me, is the layout of major page elements. The whole box model is pretty powerful, but it is unintuitive and there are some things it just can’t do. Imagine a page laid out like this:

header:left header:right
main content navbar
footer:left footer:right

Near as I can tell, this is almost impossible using straight CSS. It might be possible if the header and footer areas are fixed height, probably meaning they contain mostly graphics. It would probably require a lot of extraneous DIV tags. DIV tags are fine up to a point, but nesting a bunch of DIV tags just to get a page to lay out correctly goes against the spirit of structured HTML. Might as well use a table-hack layout after all.

It seems like something that was cooked up to be elegant on a theoretical level without much regard for the kinds of layouts people might actually want to achieve. The layout of this page was achieved through some code that I consider inelegant and brittle.

Wisteria

Had lunch with Gwen at Saltillo Plaza, the train station to nowhere on East 5th St. The place is going crazy with wisteria.


Microsoft’s slogan

Heard on NPR: “Your potential inspires us to create the software to help you reach it.” Or something like that. Microsoft’s bloatware philosophy applies to advertising, too.

The bidding to rebuild Iraq has already begun

This New York Times article suggests that Gulf War II isn’t about oil as an end–it’s just a means to an end: to enrich American construction firms like, oh, Halliburton (Dick Cheney’s employer (note that I intentionally left out the word “former”)).

Let’s see if I’ve got this straight. We (for the purposes of this entry, “we” means “they”) declare war on a country and bomb it back to the Stone Age. In a vast ($25 bn+) humanitarian undertaking, we rebuild the country, using Iraq’s oil money to pay for it. Sort of a roundabout way to transfer Iraqi wealth to corporate America.

Some thoughts:

  • Iraq has the world’s second-largest proven oil reserves. I can imagine a scenario where the USA keeps the forthcoming client regime on a short leash, forcing it to keep oil prices low. That will depress oil prices throughout the world (Good for SUV drivers!), and keep Iraq in debt to the USA (or more accurately, corporate American interests) indefinitely, since it won’t be able to pay down its boggling debt quickly.
  • It would have been nice if we could have just concentrated on rebuilding (or building) Afghanistan instead, but they don’t have the oil reserves
  • I sure am glad the bidding process has received all the public scrutiny it deserves.

Lost in La Mancha

Saw Lost in La Mancha on Friday. This is a documentary of the doomed effort to produce Terry Gilliam’s magnum opus, the story of Don Quixote. Gilliam had been working on the idea since 1991, and only managed to start filming in 2001. The undertaking was terribly precarious even before it began, and as soon as it did begin, almost everything that could go wrong did, from big things to little. Floods, fighter jets, illness, and recalcitrant horses.

The documentary made the point that Gilliam himself was somewhat like Don Quixote on a gallant but unrealistic quest, and indeed, there was an amazingly tidy parallelism between the story and the story-in-the-story. But something at the very end of the movie made me think that Don Quixote is the wrong fictional archetype to describe Gilliam. Ahab is more like it.

Scroll to Top