the anvil conspiracy | blog | CSS Hates Me

CSS Hates Me

June 30th, 2005
by Jason Landry
Posted in Rants, Technology

Ok, maybe not CSS, but someone surely does.

Recently, in addition to the redesign of this site, I did a redesign for Ribit. I wanted to break out of the standard web layouts, the ubiquitous two column, navigation left or across the top concept that seems to dominate the web. I also wanted to some of the more esoteric technology available to create some interesting effects using CSS and the DIV tag.

To my chagrin, I found that while you can do some really cool stuff these days using CSS and DIV, it breaks down in – you guessed it – Internet Explorer. IE literally ignores about half of the current parameters that are built into the CSS standard. My biggest pain while doing the two aforementioned sites was the dreaded "fixed" position statement for DIV tag layers. You see those columns of textured color on the right? Notice how they do not move? Well, if one is designing strictly for standards compliant browsers such as Firefox or Apple's Safari, one can get that neat effect by simply creating a DIV layer, giving it the appropriate size and position, and then adding the following to the CSS code:

Code:
position:fixed;

That's it. One line, a total of 15 keystrokes. Beautiful. And then you look at it in IE, and not only is not not fixed, but all of your position coordinates are ignored, so the layer ends thrown far and wide from your intended placement.

After a bit of research, I found that there is a workaround. It involves the use of a proprietary IE technology called Conditional Comments. A conditional comment is a way of having the browser use a different or modified set of CSS instructions. Conditional Comments are only recognized by IE, of course, so what they are really for is allowing workarounds like what I had to use to make things look the way I wanted in IE. A Conditional Comment look like this:

Code:
<!–[if IE]>

<link href="IEversion.css" type="text/css" rel="stylesheet" />

<!endif]–>

By using this method, one is able make IE use an auxiliary CSS, overriding the standard compliant CSS you originally created. In this case, to get the fixed position effect, I had to specify CSS that eliminated scrolling from the page, and put it back in using a DIV layer that filled the page top to bottom. Anything that scrolled had to go inside this nested DIV, anything fixed had to go outside. This necessitated adding many lines of code in the CSS, and a few lines in the page headers as well. Not even counting the time to research and discover this workaround, it put me many hours behind on these projects and killed my productivity, all because the highly paid programmers at Microsoft can't be bothered to implement a simple CSS standard, one which is easily implemented in all other browsers, including those that are open source projects with unpaid developers. Now, that was aggravating enough, and I steamed about it for a few days, and then an even worse thought hit me.

Microsoft was unwilling to spend the time to implement standard CSS, that much is obvious. But they did take the time to implement a proprietary system of conditional comments to allow work arounds for certain CSS styles. Why did they not spend those development resources implementing the standard? They obviously have the resources, why don't they use them wisely? Is this incompetence or malice? Microsoft has a history of attempting to overturn any standard that is not in their control, this is well-documented. Are they attempting the same thing here?

I have no proof either way, obviously, but I think I can say with some confidence that either that level of incompetence or that sort of malice is unacceptable in a company that dominates the market the way they do.

One Response to “CSS Hates Me”

  1. [...] 4 years ago, I wrote, in one of the first ever of my incredibly…um…occasional…blog entires, of my issues in making what should [...]