« Roses have thorns, | Main | The Rabbit »

Browser discrimination

Well, after I got my whining out of the way, I found some nifty tricks for making our front page work for standards-impaired browsers without sacrificing anything on the nice ones.

It works like this: First, assume all the layout is handled by CSS, with the content in as-bare-as-possible XHTML. (This allows for easy design changes; one just tweaks the styles, rather than messing with markup integrated in the content.) Second, recognize that while most of the CSS works on most of the widely-used browsers, certain specific sections will break on certain specific browsers. So instead of embedding the styles on the page, they get split into two external files. One contains a full layout which works with the widest possible range of browsers. The second contains those sections which break; it is imported using a specific syntax which the “crippled” browsers don’t understand, and overrides the safer style rules.

It’s almost like the height lines at the gates of amusement park rides: if you’re not this tall, you can’t ride. If you don’t understand this syntax, you don’t get the good stuff. I’m sure this is old hat to the professional designers, but I just do this part time (just like I do sysadmin part time, and support, and network admin…) It’s fun for me because it’s something new. I like feeling as though I still have stuff to learn, like I’m still on an upward path.

There’s a great page with a matrix of tweaks like this. I love it. I’ve got most of the people who will be approving the site on modern browsers (actually, all three of them are using Mozilla primarily now) so they’ll see the good stuff. But it will degrade gracefully for the stubborn IE/Mac or Netscape 4 users. (It’ll look a bit plain for them, but it won’t be a godawful train wreck, and that’s worth something.)

Now playing: Moscow Song from Appetite by Kris Delmhorst

Comments

You’re going to love the Project’s new site. check it out on June 2…CSS, RSS, the works!

Post a comment