CSS and XHTML and standards

Our Unix/VMS admin popped his head over his cube the other day and asked me if I’d tried a particular site on our corporate intranet under Galeon in Linux. I hadn’t; I’d never had occasion to use the site. I was booted into Wintendo at the time, which is normal, since I’m basically an NT administrator. Personal beliefs about Windows aside, administering NT pays the bills, and computers are tools, not a religion.
But my workaday browser is K-Meleon, a lightweight browser based on the Mozilla project’s Gecko engine. It’s small, it’s fast, it’s standards-compliant, and it’s easy to tell it to ignore the JavaScript code that creates popups and popunders. So I tried visiting the site in question with K-Meleon.

Denied.

This made me mad. TCP/IP, HTTP, and HTML were all intended to be cross-platform. The first graphical Web browser was written on a NeXT, for crying out loud! NeXT! How many people today even know what NeXT was?

Of course, when you use Microsoft Web servers serving up pages using Microsoft tools, all the rules change. Microsoft doesn’t even care about previous versions of its own browser. Rule #1 of Web design, which most designers have sadly forgotten, is that you test your site with several different browsers, and preferably several versions of them. It’s easy to make multiple versions of Netscape happily coexist on a machine, but Microsoft has made it next to impossible for more than one version of IE to exist on a machine without resorting to multi-booting. With IE4, IE5, IE5.5, and IE6 all in widespread use and the wretched IE3 unfortunately not extinct, that’s a burden.

A couple of days later, the site’s administrator came back with a snippy response: Use the company standard Web browser.

This, to a Unix and VMS administrator. The only time he ever runs Windows is to fill out his timesheet, since we use a Windows-only app to do it. He’s got a beat-up Micron Pentium-166 in the back of his cube for that purpose. While he could do his job with a PC running Windows and a decent Telnet client, he’s much better off running Linux. He can develop shell scripts locally before sending them up to our big Digital Unix box. Running Linux makes him more productive.

But forget him being able to do his job. He needs to run Windows and Internet Exploiter so he can log into this Web site.

While we’re at it, forget that Internet Exploiter has security holes big enough to drive a truck through. Forget that keeping IIS patches up to date is a full-time job in and of itself. Let’s be Microsoft lackeys. All hail Gates and Ballmer.

I guess the few remaining Mac users at work are going to have to get PCs so they can use this intranet site as well. While I can think of reasons to replace Macs with something else, the inability to display a Web page isn’t among them.

Want to know why it’s a really bad idea to code for just one browser?

Internet Exploiter users can’t read this paragraph, so, those of you who, like me, use a real Web browser written by someone other than an imperialistic monopolist, can share in a dirty little secret. Want to know how to sabotage inept browsers and encourage the use of standards-compliant browsers like Opera and the Mozilla family? Use the tag. Simply nest something inside and , and those who have yet to be liberated from the Evil Empire won’t be able to read it. (Remove the leading and trailing spaces–I had to put those in because some browsers don’t interpret the less-than/greater-than sequences either. Hmm…)

If you want to really be nasty, code your pages so that the only thing visible outside of those tags are the words, “This site can only be viewed with something other than Internet Explorer.” You’ll hack a lot of people off, but you’ll make your point.

Quick question: What’s the first line of the paragraph immediately preceeding this one? If your answer is, “Want to know,” you’re running a Microsoft browser. If your answer is “Internet Exploiter users can’t read this paragraph,” you’re not. There are two paragraphs here nested in non-standard tags. Browsers not made in Redmond correctly ignore this tag and display the text.

There are plenty of sites on the Web that ignore non-IE browsers for no good reason, and who could easily support everything by just following industry standards.

So, for security, what’s wrong with .htaccess files? They work, they’re easy to use, and they don’t tie you to any particular OS or browser on the client side. Especially on a corporate intranet, they’re great.

For layout, what’s wrong with sticking with standard XHTML and CSS? It’s easy to create beautiful pages that look beautiful in any modern browser (not just the one you happen to have installed on your machine), and remain perfectly readable in text browsers and ancient versions of the old standbys. Here’s a great tutorial on basic text styling, a more complete tutorial, some tips on converting existing content, and a site with several elegant layouts you can steal and adapt.

You can even do a cool trick to give your users a choice between your design and the preferences they set in browser setup.

It’s not incredbily difficult to make a layout that looks extremely good and is easy to navigate, plus is readable on all browsers, plus allows the user to gracefully resize it. The end result is files that are smaller than old-school HTML, so the pages download and render faster.

XHTML and CSS are all the rage now, with tutorials in the popular press, and with bloggers flocking to it. It goes a long way towards solving the complaints I had about HTML when I was learning it (let’s face it, when you’re used to designing in QuarkXPress, HTML 3.0 is just plain clunky) so talented designers can do some really impressive things with it.

I’m going to start moving in that direction. It’s time we all did. It’s time to take back the Web. Install Netscape 6.2 and Netscape 4.79 on your machine so you can check your pages in them. At the very least, install OffByOne to ensure your pages are viewable in a third-generation browser (it’s just 1.2 megs in size, so it won’t kill you).

XHTML and CSS are cool if you’re the artsy type, but they’re more than just cool. They’re the right thing to do. I hope I can find the time…

As as for that Intranet site at work? If using it ever becomes part of my job, I’ll re-code it and store it on an Apache server, protected by an htaccess file to show how easy it is to develop cross-platform apps on the Web. After all, it’s what it was designed for.

Not that I expect anyone to listen. It’s distressingly hard to find people who think for themselves, rather than just repeating everything that Microsoft tells them.

3 thoughts on “CSS and XHTML and standards

  • March 19, 2002 at 7:04 am
    Permalink

    Gee, usually I don’t have anything useful to add to Dave’s posts; but in this case, drop by my blog (rather than my Daynotes site): I just flipped it over to XHTML Monday morning.

    An interesting experience, with more to add in as I learn. The only issue I’ve found so far is the background gradient will not render in IE4. …but the content is still available.

  • March 20, 2002 at 1:46 am
    Permalink

    K-Melon! I almost forgot about that one. It’s a sweet little browser that’s easy on the system load and quick on the rendering.

  • March 20, 2002 at 10:50 am
    Permalink

    I’ve been mucking around in CSS for the past few months, and really like how I can layout pages. For my personal site, a CSS format is in development.

    I also design a site that gets about a million hits a year and too many people are using browsers that don’t support css2, so for that site I’m stuck with HTML and Tables. For a more tech oriented site, CSS and XHTML are great, but it’s not ready for general purpose until people upgrade to the lastest 6.0 browsers.

Comments are closed.

%d bloggers like this:
WordPress Appliance - Powered by TurnKey Linux