Archives

Anticipation

  • No dates present

Standards of Style

As I’m making various tweaks to the site’s theme to make it more unique (and hopefully interesting), I came across an interesting page about creating buttons almost entirely within CSS — meaning that the text for the button can be taken from the HTML, and thus changed easier as there’s no need to create all the images up front. I tried it out and it worked beautifully under Firefox.

Unfortunately, this was not the case with IE 👿 — apparently IE has a different (read: non-standard) box model implementation. Supposedly IE6 will use the standard model if it sees a page with a standard DOCTYPE (which this site does, of course), but that didn’t appear to be the case either. And while it’d be nice to just let the IE users suffer, there’s still a lot of them out there, so that strategy is pretty much self-defeating.

I know there are a bunch of hacks available that trick different browsers into reading different rules in the CSS files, but I haven’t really made a study of that sort of thing. Besides, it’s always struck me as both fragile (who knows what future versions of the browsers will do?) and ugly.

So I ended up using static images instead, specifically some generated by the Glass Button Generator and then tweaked a bit. I did however use the CSS trick for doing JavaScript-less rollovers — I hadn’t seen that one before and it’s quite cool. But unfortunately this means that the dynamically-generated links (such as the Login link) couldn’t be turned into buttons. Sigh.

This is one of the reasons why I never got all that into CSS, and why most of my hand-built sites are made using table-based layouts rather than CSS and <div>s. At least those are consistent across browsers. Maybe one day the support will be consistent enough between browsers for it to be viable (or maybe I’ll just have to learn some of those hacks after all), but for now it just doesn’t seem worth it.

One final thought on the matter before I shut up again: I found it quite interesting what Microsoft had to say about standards in their own documentation. Specifically, it says:

In standards-compliant mode, compatibility with other versions of Internet Explorer is not guaranteed. When standards-compliant mode is switched on, the rendering behavior of documents might differ in future versions of Internet Explorer. You should not use this mode for content that is fixed in nature, such as content that is stored on a CD.

Ok, possibly I’m reading that strangely, but isn’t the whole point of a standard to render the same everywhere? So if IE6 complies with the standard now, and IE7 complies with the standard later, then they ought to render the same. Yet this paragraph seems to be saying the exact opposite, and in fact sounds like it’s trying to scare you off running IE as “standards-compliant”. Unless maybe it is an admission that IE6 doesn’t actually follow the standard after all (which is what my testing seems to indicate). Either way, it’s weird.

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>