CSS Philosophy

Subject: CSS Philosophy
From: Isaac Rabinovitch <isaacr -at- mailsnare -dot- net>
To: techwr-l
Date: Thu, 15 Jan 2004 17:11:56 -0800

Guy K. Haas wrote:


Isaac Rabinovitch wrote:


When you pick a nit, at least please report what browser has this problem.


Well, it's more than a nit, but I do owe you an apology. After studying your CSS, and doing some research, I'm forced to concede that there must be a bug in my browser's handling of relative positioning. It fails Eric Meyer's tests:

http://www.meyerweb.com/eric/css/tests/css2/sec09-08-02.htm

What's my browser? It's IE 6. Not the released version (I checked, and it doesn't have this bug). I have the Internet Explorer that comes with XP SP2 beta. I installed this software (illegally, don't tell Bill) because it contains a fix for the famous IE scrollbar bug. But it also seems to have new bugs in in the rendering engine. Pretty sad, even for a beta.

So, my bad.

Still, you raise some issues that might be of general interest when you comment,

But, it looks fine in Opera 6.01, Mozilla Firebird 6.0.1 (no relation), Mozilla 1.4, and Internet Explorer 5.5.4807.2300

A small point: when you test something on Mozilla Firebird and Mozilla, you're not testing two different HTML engines, since they both use Gecko.

Slightly bigger point: I hope you understand that the acid test for good CSS is not "It looks good in widely used browsers." One of the gools of this whole style sheet thing is to avoid the whole browser quirks tarbaby. So checking your CSS in a browser serves as a basic sanity check, no more. Your ultimate goal is to write HTML and CSS that follows the rules for these languages, and thus can be expected to work on every imaginable browser, including ones that haven't been invented yet. The only requirement is that these browsers interpret your CSS correctly -- or if they're too primitive for CSS, they ignore it completely.

Of course, you can't be expected to support browsers (like mine) that are simply broken. That being said, I think there's a serious lesson to this particular glitch.

Which brings me to my really big point. The CSS my browser choked on was really, *really* complex. This complexity comes from the main purpose of the styles in question, which is to replace the functionality of a simple HTML table. Which is completely unnecessary. Yes, most HTML tables are evil. But that's because they're used for laying out huge gobs of content -- often the entire web page -- in a way that's hard to maintain and violates the separation of content and presentation. But there's no reason not to use HTML tables to display a simple, small 2x2 grid. Especially when the web page is a front end for a database application, not actual content.

In brief -- your CSS does work (except on my buggy browser, which doesn't count), but it's a complicated, brittle solution for a problem that isn't actually a problem.




References:
Re: STC.org: From: Isaac Rabinovitch

Previous by Author: Re: STC.org
Next by Author: Re: Trademark Possessives
Previous by Thread: Re: STC.org
Next by Thread: Re: CSS Philosophy


What this post helpful? Share it with friends and colleagues:


Sponsored Ads