Do any of you other web developers ever feel like the advent of CSS-as-God is nothing but a make-work project for all of us? Like somewhere, somewhen, the mythic Web Developer’s Professional Association got together and realized “Hey, shit! this web-dev stuff is too easy! I mean, my mom’s built her own website. And my grandmother’s heard of font tags and knows how to nest tables! We need to bring control of this thing back to the geeks!” And so was born CSS.
Reading Zeldman’s recent posts about redesign, and my own recent experiences wrestling with CSS, it makes me wonder. Just look at the plethora of hacks & tricks sites that are out there.
Back in the day, when something wasn’t right, I added a spacer, or nested a new table and it was done. Now, I know off the top of my head, at least 40 different hacks that I regularly have to use to implement CSS to work properly across the various browsers.
Now, it’s all good and well to blame the browser makers for their shitty implementation. But somewhere, deep inside, I think that really, the complex CSS-driven, standards-adherent, markup-validating holy grail that we all aspire to (or are at least told that we should) might be nothing more than a way for an otherwise passé profession to retain relevance & meaning.
And here’s what really gets my goat. Given the various DocTypes, why isn’t CSS support & implementation decided along side? I mean – if that controls (to some degree) how the browser interprets the HTML, why can’t that control how the browser interprets the CSS? I’d certainly be willing to add in a secondary CSS doctype to get cross-browser/platform compliance. I figure it would work like this: The browser checks what compliance level to use. If it has this cached, it lods up the appropriate file, and uses that to interpret the site. If it doesn’t, it goes to the source listed in the doctype, downloads the sheet and then runs the site. This opens all sorts of doors, as the root file could be regularly updated, and those updates would almost immediately spread across the entire internet, meaning, essentially, consistent, up-to-the-minute support of new CSS standards. If sites don’t declare a doctype, then the browser can use whatever file is its default to interpret the site — because at that point, it’s the site developer’s fault, not the browser’s.
(Please excuse my glaring ignorance as to how CSS engines & browsers actually work, as I’m sure my above idea actually does. This is one of those wouldn’t-it-be-nice? posts)