1.6. Nonstandard Extensions
It doesn't take an advanced degree in the obvious to know that many people vie for distinction to draw the attentions of others. So, too, with browsers. Extra whizbang features can give the edge in the otherwise standardized market. That can be a nightmare for authors. A lot of people want you to use the latest and greatest gimmick or even useful HTML extension. But it's not part of the standard, and not all browsers support it. In fact, on occasion, the popular browsers support different ways of doing the same thing.
1.6.1. Extensions: Pro and Con
Every software vendor adheres to the technological standards; it's embarrassing to be incompatible and your competitors will take every opportunity to remind buyers of your product's failure to comply, no matter how arcane or useless that standard might be. At the same time, vendors seek to make their products different and better than the competition's offerings. Netscape's and Internet Explorer's extensions to standard HTML are perfect examples of these market pressures.
Many document authors feel safe using these extended browsers' nonstandard extensions because of their combined and commanding share of users. For better or worse, extensions to HTML made by the folks at Netscape or Microsoft instantly become part of the street version of the language, much like English slang creeping into the vocabulary of most Frenchmen, despite all the best efforts of the Académie Française.
Fortunately, with HTML Version 4.0, the W3C standards caught up with the browser manufacturers. In fact, the tables turned somewhat. The many extensions to HTML that originally appeared as extensions in Netscape Navigator and Internet Explorer are now part of the HTML 4 and XHTML 1.0 standards, and there are other parts of the new standard that are not yet features of the popular browsers.
1.6.2. Avoiding Extensions
In general, we urge you to resist using an extension unless you have a compelling and overriding reason to do so. By using them, particularly in key portions of your documents, you run the risk of losing a substantial portion of your potential readership. Sure, the Internet Explorer community is large enough to make this point moot now, but even so, you are excluding several million people who use Netscape from your pages.
Of course, there are varying degrees of dependency on extensions. If you use some of the horizontal rule extensions, for example, most other browsers will ignore the extended attributes and render a conventional horizontal rule. On the other hand, reliance upon a number of font size changes and text alignment extensions to control your document appearance will make your document look terrible on many alternative browsers. It might not even display at all on browsers that don't support the extensions.
We admit that it is disingenuous of us to decry the use of extensions while presenting complete descriptions of their use. In keeping with the general philosophy of the Internet, we'll err on the side of handing out rope and guns to all interested parties while hoping you have enough smarts to keep from hanging yourself or shooting yourself in the foot.
Our advice still holds, though: only use an extension where it is necessary or very advantageous, and do so with the understanding that you are disenfranchising a portion of your audience. To that end, you might even consider providing separate, standards-based versions of your documents to accommodate users of other browsers.
1.6.3. Beyond Extensions: Exploiting Bugs
A good example is the multiple-body bug in Version 1.1 of Netscape Navigator. The HTML standard insists that a compliant document have exactly one <body> tag, containing the body of the document. The now-obsolete browser allowed any number of <body> tags, processing and rendering each <body> in turn. By placing several <body> tags in an HTML document, an author could achieve crude animation effects when the document was first loaded into the browser. The most popular trick used several <body> tags, each with a slightly different background color. This trick results in a document fade-in effect.
The party ended when Version 1.2 of Netscape fixed the bug. Suddenly, thousands of documents lost their fancy fade-in effect. Although faced with some rather fierce complaints, to their credit, the people at Netscape stood by their decision to adhere to the standard, placing compliance higher on their list of priorities than nifty rendering hacks.
Copyright © 2002 O'Reilly & Associates. All rights reserved.