After trying to re-design 3 websites using CSS-only layouts, I have had to re-think a few things about CSS, standards & web design.
Not so standard
Cascading Style Sheets (CSS) sound great on paper, a screen, or screen reader. That's the theory, anyway. I recently got excited again about web design when I started learning about the potential benefits of using CSS to format web pages. It all sounded great to me, until I tried my hand at fashioning a layout using CSS, and no tables.
I very quickly realized the limitations; CSS is supported differently by each and every different browser out there. So, I can design a layout that makes perfect sense according to the standards set down by the W3C, but some wonder-brat code-monkey at Microsoft decided to use a different box model, so the page will look completely different in Internet Explorer (IE) than intended. Or, a bug in Opera causes floated elements to behave strangely. Older browsers don't fully support even the complete set of CSS1 rules, so things get left out. I've seen Netscape 4 (NS4) garble a page that looks perfectly normal on Safari, and even older versions of IE crash when faced with perfectly standards-compliant CSS code.
Web designers have known about this issue for a long time, and have developed a few strategies to cope:
- CSS hacks & workarounds
- creatively spicing up the CSS code, exploiting one browser's bugs to solve another bug, resulting in the same layout in each browser. This approach requires a lot of testing - in each and every version of each and every browser - and targetting specific commands to each such browser to achieve the proper effect. I'm an amateur web designer, who also happens to be a graduate student! I don't have the time or resources for this!
- Convincing people to actually follow the standards
- lobbying the software developers to make standards-compliant browsers, and convincing users to upgrade to these standards-compliant browsers. The folks at the W3C and especially the Web Standards Project (WaSP) have done a great job of this.
The New Face of the Web
Many of the older browsers with poor CSS support are now used so infrequently that it has become relatively practical to simply shield these older browsers from CSS altogether; these browsers only ever get to see the raw HTML. Sure, the page looks boring, but at least you can read it. Any computer still running these older browsers most likely will never be able to upgrade anyway, and will eventually fall into disuse.
There are now some really great, standards-compliant browsers out now, such as any gecko-based browser (Mozilla, Netscape), and Apple's Safari (Apple always tries to do things better). Even IE has come a long way to being more standards-compliant. Although IE (Mac) was the first browser with 100% support for CSS 1, it fallen behind, and has not been updated in years. For instance, IE 6 still does not support:
position: fixed
width: auto
- child selectors (i.e.
html>body
) - and it often requires widths to be specified explicitly, in order to draw border & backgrounds properly.
So, I usually end up designing a page that looks the way I want in Safari & Mozilla, and then testing in IE and adding IE-specific corrections just for that cursed browser. Microsoft (& Bill Gates) has become a plague upon sensible & intelligent computing design.
Normally, I have adopted the following strategy: I code to standards, and if a browser can't handle it without making a page illegible, it doesn't get to see the code (more on this later). I can quite easily prevent IE from ever seeing the CSS, even using valid statements, but I realized I couldn't afford to do that wholesale to all my CSS code.
The scourge that is Evil Internet Explorer (IE)
This is because IE is the single most popular browser on the internet. Last I checked (for 2003), IE 6 was used by at least 60% of people on the internet, with older versions totalling about the same. Over 95% of all browsers are some version of IE. About 5% of users are on Netscape or Mozilla, leaving a few miniscule slices for all other browsers. Many believe that having IE bundled with MS Windows is responsible for IE's domination. Netscape used to dominate, until IE came on the scene. Microsoft has been taken to court with allegations that this is an unfair business practice.
Mozilla (or Netscape), and Safari (for Mac OS X) are the most common alternatives, but there are other free ones out there - have a look for yourself. It certainly seems to me that most users out there are simply not aware that there are, often better, alternatives to what has been handed to them in a free package. Designers the world over seem to be catering to this lowest common denominator, because they feel they have to accomodate the hordes of ignorant IE users. I have tried to convince people to switch to a more-standards-compliant browser that uses less memory, runs faster, and isn't full of security bugs, and the response I typically get is "well, IE works fine, why should I bother to replace it?" The dramatic shortcomings and dangers of using IE are not apparent to most users, in part because designers work so hard to accomodate them (even if it means having to bend the standards that IE doesn't support.
In fact, I find that many "Internet-based Applications", including the Student information System at my University, does not support browsers other than IE. The older system didn't support any Mac browsers at all (despite being a relatively mac-friendly campus). The new one freezes, or doesn't work properly, unless it's running under IE (Mac/Win). I would have deleted IE on my mac, except for the fact that I may need it to access and use sites that require it.
We are still caught in a vicious cycle. We try to convince people to make better products. We try to convince people to use better alternatives, but after all that, the most common browser is now the least standards-compliant. So, we feel we have to support it. This only encourages users to remain complacent, and continue to use an inferior product.
Conclusion
So, who sets the standards? The W3C has done an amazing job of defining systems & methods for interoperability. The guys at the Web Standards Project are out there lobbying people to adopt these standards. But, if the single most-popular browser on the web doesn't support them, where are we? In "the real world", we are slaves to the popular user; it seems that the public masses define what is "standard" and used most often.
Ultimately, I suppose each web site needs to know it's own clients, and what they use. But, for us amateurs, we're stuck having to support a crappy, yet popular browser. Here's my plea to the internet community: stop using Internet Explorer! Microsoft has already announced there will be no new (free) versions for any platform. Please, let it die. Get a better browser. For the sake of a better internet.