Netscape Communications Corporation's Navigator is easily the most loved-and most hated-browser on the Web. By most estimates, at least 75 percent of Web users use Netscape, and some estimates put that figure as high as 90 percent. One reason that Netscape is so popular is that the company has introduced non-standard tags that enhance the appearance of a site. The good news is that most of these tags work-they really do make a site look better. The bad news? You have to have Netscape (or one of the few Netscape-compatible browsers) to see the enhancements.
While the Internet community debates the relative merits of the browsers and has agreed to disagree about whether sites should be developed that make explicit use of Netscape extensions, one fact seems clear: no serious Webmaster can be without Netscape Navigator. The reason for this is obvious. If he or she has decided to use Netscape extensions, Navigator is needed to test the pages. If the Webmaster wants to develop pages that don't rely on Netscape, he or she will still need to see what the client sees when the client says, "I want my page to look just like ."
These decisions are becoming easier now that many "Netscapisms"
are moving into the mainstream of HTML standards. Be sure to compare
the HTML 3.2 specification, which became a proposed recommendation
on November 5, 1996, with the list of Netscape enhancements. Because
Netscape has announced that it will conform to the standard when
it stabilizes, you should use HTML 3.2 tags instead of Netscape-specific
tags whenever you have the choice.
ON THE WEB |
http://www.w3.org/pub/WWW/MarkUp/Wilbur/ Get an overview of the features specific to HTML 3.2 from this site, and compare them to the Netscape-specific tags described in this chapter. |
ON THE WEB |
http://home.netscape.com/comprod/products/communicator/faq.html This page contains a Frequently Asked Questions list about Netscape Communicator (a suite of products that includes Navigator 4.0). Question 1 under Netscape Navigator 4.0 links to information about absolute positioning, layering, and style sheets-new tags and attributes introduced in Navigator 4.0. |
If you want to start a flame war, just go to any Internet discussion group that talks about Web site development and say either "Netscape Navigator is the greatest thing that ever happened to the Web," or, "Netscape Navigator is the worst thing that ever happened to the Web." Either comment will polarize the group-plenty of folks will agree with your comment, and about the same number will object vehemently. Of course, in the better groups you'll get some private e-mail that says, "We've already had this discussion, and have agreed to disagree. Please see the archives for details."
Developers who cherish the open standards process by which HTML was developed are concerned that the introduction of Netscape-specific extensions to HTML will confuse and distort the market. Browser vendors who "play by the rules" and concentrate on standard HTML tags lose out when the marketplace demands the Netscape enhancements.
To their credit, Netscape Communications has stated publicly that they support open standards. They participate in the standards discussions, and have proposed each of their extensions to the standards working groups for adoption. Indeed, many such tags have found their way into the HTML 3 standard in some form.
The debate on whether Netscape is the greatest browser ever or a threat to the free world will not be settled here. Instead, this chapter deals with the reality of Netscape and the demand for enhanced pages, and describes a process by which your pages can look good with most popular browsers.
David Ornstein, developer of BrowserCaps, sums it up this way:
Tip |
If you're building an application exclusively for a corporate intranet and you know that everyone who uses the application uses the latest version of Navigator (or a Navigator clone such as Microsoft Internet Explorer), you may be able to ignore much of this chapter and write pages exclusively for Navigator. It's amazing how often one or more of those assumptions breaks down, even in the best-run intranets. When in doubt, be guided by the HTML standard, and add Netscape enhancements only when necessary to get a specific feature or effect. |
BrowserCaps BrowserCaps (http://www.pragmaticainc.com/bc/) is the definitive on-line source for information about the capabilities of each Web browser.
Table 4.1 contains a summary of the capabilities of Netscape 3.01,
given by BrowserCaps in November 1996. Check BrowserCaps from
time to time to see how the capabilities of the various browsers
have changed.
Note |
In BrowserCaps and many other parts of the Web, the Netscape browser is known as Mozilla. It's a long story . |
BrowserCaps Test | |
Anchors | |
Link titles (title attribute in <A>) | |
Mailto address, as a hyperlink | |
Specification of author's e-mail address (<LINK REV=MadeHREF="mailto:...">) | |
Character Formatting | |
Big text (<BIG>) | |
Font color for all body text (text attribute in <BODY>) | |
Font color for arbitrary text (color attribute in <FONT>) | |
Font sizing (size attribute in <FONT>) | |
Small (<SMALL>) | |
Subscript (<SUB>) | |
Superscript (<SUP>) | |
Dynamic Content | |
Marquee (<MARQUEE>) | |
Entities | |
Accented entities | |
Headings | |
Heading levels (1 through 6) | |
Images and Figures | |
Alternative image text (<IMG ALT=... >) | |
Figures (<FIG>) | |
Image spacing (<IMG HSPACE>) | |
Image transparency | |
Inline GIF87 images in <IMG> | |
Inline GIF89a images in <IMG> | |
Inline JPEG images in <IMG> | |
Inline PNG images in <IMG> | |
Inline XBM images in <IMG> | |
Multiple resolution image fade-in (<IMG LOWSRC="...">) | |
No border on linked images (<IMG BORDER=0>) | |
Progressive-mode JPEG images | |
Right-aligned images (<IMG ALIGN=Right>) | |
Scaling images (<IMG WIDTH=... HEIGHT=... >) | |
Lists | |
Custom bullets for list entities (<LI SRC="... ">) | |
Definition lists (<DL> tag) | |
List headers (<LH>) | |
Nested definition lists (<DL>) | |
Ordered (numbered) lists (<OL>) | |
Paragraphs in list items (<P> in <LI>) | |
Sequence numbers in lists (<OL SEQNUM>) | |
The <DIR> list element | |
Paragraph Formatting | |
Center-aligned paragraph (<CENTER>) | |
Paragraph center alignment (<P ALIGN=Center>) | |
Paragraph justification (<P ALIGN=Justify>) | |
Paragraph left alignment (<P ALIGN=Left>) | |
Paragraph right alignment (<P ALIGN=Right>) | |
Preformatted text (<PRE>) | |
Return to default alignment (<P ALIGN>) | |
Parsing | |
Basic comment | |
Entities in ALT attribute (<IMG ALT>) | |
HTML comments containing markup | |
Right angle bracket in ALT attribute (<IMG ALT=>) | |
Tables | |
Anchor targets in tables (<A NAME> in <TABLE>) | |
Basic table (<TABLE>) | |
Headings in tables (<H3> in <TABLE>) | |
Post-break in table cell (<BR> in <TABLE>) | |
Post-para in table cell (<P> in <TABLE>) | |
Pre-break in table cell (<BR> in <TABLE>) | |
Pre-para in table cell (<P> in <TABLE>) | |
Table inside a table (<TABLE>) | |
Table with an image in one cell (<IMG> in <TD>) | |
Whitespace | |
Multiple breaks (<BR>)-should not be supported | |
Multiple non-breaking spaces ( ) -should not be supported | |
Non-breaking space ( ) | |
Whole document | |
Background color (<BODY BGCOLOR="... ">) | |
Background patterns (GIFs) | |
Background patterns (JPEGs) | |
Frames (multiple documents) support | |
Server push (multipart/x-mixed-replace) |
The following is a description of each of these tests:
BrowserWatch Recall that BrowserWatch, at http://browserwatch.iworld.com/stats/stats.html, maintains statistics on the relative popularity of each browser. In 1994, the leading browser was Mosaic. In 1995, Netscape took that title. It's entirely possible that Netscape could be dethroned within the next year by a new contender. Check BrowserWatch regularly and follow the discussions in the HTML Writers Guild mailing lists or comp.infosystems.www.* to see which browsers and features are being widely accepted.
The preceding information about Netscape reveals a pattern. Many tags or attributes that Netscape recognizes are already a stable part of the HTML 3.2 proposed recommendation and can be used freely. There are other elements that are part of the standard, but have not yet been widely adopted. These elements, of course, should be avoided.
Still other features can be implemented in either a Netscape-specific fashion or an HTML 3-compliant fashion. In general, the HTML 3 style should be favored. Netscape Communications has said that it will fully support HTML 3 when it stabilizes, so HTML 3 elements will work in Netscape as well as all other HTML 3-compliant browsers.
Finally, there are some attributes that are specific to Netscape.
You should avoid many of these. If a site seems to require Netscape-specific
functionality, use the techniques from this chapter to deliver
Netscape-specific code only to Netscape browsers.
ON THE WEB |
http://www.phone.net:80/home/mwm/netscape/ The remainder of this section is adapted from Mike Meyer's original paper on Netscape's extensions to HTML, available at this site. |
Extensions that Conform to HTML 3 The following elements are supported by Netscape and the HTML 3 draft, and may be freely used in accordance with the HTML 3 draft:
Incompatible Elements The following capabilities are supported by both Netscape and the HTML 3 draft, but have different elements or interpretations of values. Web developers should avoid these elements wherever possible. Because Netscape eventually will support the HTML 3 standards, the Netscape interpretation of the following elements is likely to change:
Tables HTML 3 tables have had a strange "halfway" existence in Navigator. An early version of the HTML 3.0 draft specification was circulated on March 28, 1995, and the complete draft specification was released on July 7, 1995. Netscape began its implementation of tables based partly on the earlier specification, leaving inconsistencies between Netscape's interpretation of tables and the later HTML 3.0 version. For example, the original Netscape tables did not support an ALIGN attribute, and alignment defaulted to flush left (as opposed to center).
The tables in Netscape 2.0 were more compliant with the original HTML 3.0 standard, while retaining backwards compatibility with the Netscape 1.1 version. Because of the popularity of the Netscape approach, however, HTML 3.2 reflects the Netscape design more than it does the HTML 3.0 design. New pages should be written using HTML 3.2, which is supported by Navigator 2.0 and later.
Under Netscape 1.1, BORDER=n was allowed, where n was the number of pixels of thickness of the border. This style is still allowed in Netscape 2.0 and now appears in the HTML 3.2 proposed recommendation.
Similarly, HTML 3.2 specifically requires that the caption element of a table be text. Netscape 2.0 and later allows any BODY element, including headers.
The January 23, 1996 version of the HTML 3 table standard is given in "The HTML3 Table Model" at
http://www.w3.org/pub/WWW/TR/WD-tables.html
The Netscape version is at
http://home.mcom.com/assist/net_sites/tables.html
and covers both Navigator 1.1 and Navigator 2.0. The latest versions of Navigator (and, for the most part, HTML 3.2) conform to this specification.
Extensions that Have HTML 3.2 Equivalents As HTML 3 stabilizes, Netscape is likely to accept more and more HTML 3 equivalents, and the World Wide Web Consortium is accepting more "Netscapisms" into the standard. Each of the following Netscape elements has an HTML 3.2 equivalent:
Be careful with the <CENTER> tag. If you must use it, always think about how the page looks if a browser ignores the <CENTER> tag. Consider, for example, how the following code displays in a browser that does not recognize <CENTER>:
God is <CENTER>now</CENTER>here!
Perhaps the author's intention is better expressed with:
God is
<CENTER>
<BR>
now
<BR>
</CENTER>
here!
Extensions That Do Not Break HTML 3-Compliant Browsers The following Netscape extensions do not yet have HTML 3 counterparts. However, their use does not usually cause a problem in non-Netscape browsers, and is not likely to cause information loss.
Extensions That Lose Information in HTML 3-Compliant Browsers The
<BLINK> Netscape tag
has no HTML 3 counterpart. Be careful not to rely upon it to emphasize
text, since visitors who are not using Netscape (including robots
and spiders) cannot see the emphasis. Continue to use headers,
<EM>, and <STRONG>,
to add emphasis.
Note |
The <BLINK> tag is often considered the mark of an amateur. Many end users find the continuing blink irritating. If you feel tempted to use <BLINK>, consider the range of HTML 3.2-compliant phrase-level elements (for example, <EM>, <STRONG>) and try to find an alternate solution. |
Here is a process to produce a site that can be validated at several levels, and that looks as good as the browser allows:
In the rare cases where a page must be so heavily enhanced for Netscape that it becomes unusable by any other browser, consider building a separate Netscape-specific version of the page. One method of serving up Netscape-specific pages (using the <META> tag with HTTP-EQUIV=REFRESH) is given in Chapter 3, "Standard HTML." You can also use CGI or server-side JavaScript to read the "user-agent" (which names the browser) and return specific lines or even whole pages based on which browser is in use.
What About Other Browsers? In general, there are five classes of browsers accessing the Web:
As a rule, the Internet Web site developer should develop for the largest possible market, while taking advantage of as many features of the high-end browsers (including Netscape and compatibles) as possible. Consider implementing limited workarounds for the more popular broken browsers (such as those from some of the popular on-line services), and continue to encourage vendors who supply those browsers to fix or replace their products.
Why Not Build Sites that Declare "Enhanced for Netscape?" Many developers have opted to ignore the five percent or more of the market who, for one reason or another, do not use Netscape or a Netscape-compatible browser. While that is the developers' right, it seems unwise to deliberately snub a large percentage of your prospective customers. Some sites go to great lengths to tell the user which browser to use, how to configure it, and even what video mode to use. Because it's relatively easy to build a site that takes advantage of many Netscape features, without sacrificing quality when viewed with a non-Netscape browser, notices such as "best viewed with Netscape" can legitimately be interpreted as a sign of laziness or incompetence.
In the near future, it is likely that browsers and servers will use a new technique called content-negotiation to decide how to display different types of Web data. When that day comes, sites that are already friendly to many different kinds of browsers will not need to change their appearance to the user. Pages that have advertised themselves as "best viewed with [a certain browser]" will have to change that message, and also change how they serve the data.
In late 1996, Netscape began circulating beta versions of Netscape
4.0. Netscape 4.0 offers new layout and browsing features, as
well as numerous extensions and refinements when compared to HTML
3. The major changes include absolute positioning, layering, and
style sheets. Other additions, which are being incorporated into
the HTML standard, include frames, client-side image maps, and
file upload.
ON THE WEB |
http://www.netscapeworld.com/netscapeworld/common/nw.tags.html Many of the new HTML 3.2 and Netscape-specific tags are described in this NetscapeWorld article. In general, check out the Resources section of the NetscapeWorld site for an update on late-breaking Netscape news. |
In general, HTML is regarded as a markup language-HTML writers are more concerned with content than with precise placement. Other tools, such as Adobe's Portable Document Format, have been available to permit "desktop publishing" on the Web.
With Navigator 4.0, Netscape is offering more precise desktop publishing-like features. For example, if you want content (including text, images, and Java applets) to be aligned in a platform-specific manner, you might use the HTML <DIV> tag. But if you need to place the content precisely, you could use
<LAYER "layer name" x="350" y="250"> Here is my precisely positioned text. </LAYER>
The numbers in the <LAYER> tag are in pixels.
You can also specify the z-dimension of a layer, so that objects (including text) can be placed on the page in the desired front-to-back order.
Netscape gives you access to layers through JavaScript, so you can control the positioning of objects and the appearance of your page at runtime.
While HTML 3.2 give the HTML writer unprecedented control over the appearance of each element on the page, such control can get tedious. For example, suppose you want to adapt one of your existing sites (with, perhaps, dozens of pages) for a new purpose. Using HTML 3.2 only, you would have to open each file for each page and change color, font, and other tags and attributes to get the new appearance you want.
With style sheets, all that work is a thing of the past. You can build a style sheet standard for each site or client. Navigator 4.0 supports two versions of style sheets:
While Netscape has supported the <EMBED>
tag since Navigator 2.0, Microsoft uses the
<OBJECT> tag for ActiveX
objects. The HTML standard is to use <OBJECT>
to embed all sorts of content, including Java applets and non-native
media types. Navigator now supports <OBJECT>.
Frames enable the page developer to put multiple documents on one screen. The screen can be split vertically, horizontally, or both ways. A given frame can have scroll bars and can allow or prohibit resizing.
Abuse of Frames Frames can be misused to make a page absolutely hideous. The FRAME spec allows the developer to specify the size of the frame in pixels or in percentage of screen space. Anything specified in pixels has the potential of overflowing the screen. Even if the user has a large monitor, there's no guarantee that the user is looking at the site in a maximized window.
Frames also can make a page look too busy. Some sites put up three or four frames, with something different going on in each one. While this might seem useful to the developer (who is, after all, familiar with the site), dealing with so many frames can be quite confusing to a visitor.
The Proper Use of Frames A better use of frames is to keep a directory or table of contents in front of the visitor in one small frame, and present the content in another frame. Netscape itself offers an excellent example of this design at
http://home.netscape.com/eng/mozilla/Gold/handbook/javascript/index.html>
shown here as Figure 4.1.
Figure 4.1: Some of the most attractive examples of frames come from Netscape itself.
More sophisticated examples appear at
http://home.mcom.com/comprod/products/navigator/version_2.0/frames/exec_recruit/index.html
and
http://home.mcom.com/comprod/products/navigator/version_2.0/frames/eye/index.html
Tip |
When using frames, it's a good idea to specify TARGET=_top on all outbound links. This keeps the screen from splintering when pages with frames link to other pages with frames. Notice the difference between linking without TARGET=_top (see Figure 4.2) and with it (see Figure 4.3). |
Figure 4.2: Without Target=_top, the destination only fills the current frame.
Figure 4.3: When Target=_top is specified, the destination replaces existing frames.
The <NOFRAMES> Tag Netscape has anticipated the fact that many users are not able to see frames. They support a <NOFRAMES> tag; everything between <NOFRAMES> and </NOFRAMES> is sent to any client that cannot read frames. If a Web developer elects to use frames, he or she should supply a <NOFRAMES> equivalent for use by browsers that cannot handle frames.
Netscape 2.0 also introduced client-side image maps, a development long awaited by many Internet programmers. This feature is now a part of the HTML 3.2 proposed recommendation.
Understanding Image Maps To understand why client-side image maps are so welcome, you need to understand how conventional server-side image maps work. A graphic suitable for use as an image map is shown in Figure 4.4.
With server-side image maps, whenever a user clicks an image that is specified as ISMAP, the browser adds the coordinates of the click to the request sent to the server. The server picks off the coordinates and compares them to various hot spots defined in the map file. If the coordinates fall within one of the hot spots, the server returns the file associated with that hot spot.
All this computing and comparing is rather CPU-intensive. While any CPU can keep up with a few users, some servers with many image maps really suffer from the load. Furthermore, users often notice the delay, and sometimes opt to bypass the image map and go to text-based links.
Why Client-Side Image Maps Make Sense With a client-side image map, the image and map are sent to the browser. The browser interprets the click locally and requests the appropriate file from the server. The whole process is much faster and significantly decreases the load on the server and network as a whole.
How to Build a Client-Side Image Map Here is an example of a typical client-side image map:
<MAP NAME=myMap> <AREA SHAPE=rect COORDS="10, 20, 30, 40" HREF="/some/url"> ...more <AREA...> tags </MAP>
Here's how to hook it in:
<IMG SRC="some.gif" USEMAP="#myMap">
To be sure your map won't fail on a non-Netscape browser, consider formatting the <IMG> tag like this:
<A HREF="/server/imagemap.cgi"><IMG SRC="some.gif" ISMAP USEMAP="#myMap"></A>
If the browser understands USEMAP, it ignores ISMAP. If it doesn't understand USEMAP, the server-side image map program gets the click.
Prior to Netscape 2.0, forms were capable of handling text in various types of fields and simple selections like check boxes, option buttons, and pop-up menus. With version 2.0, Netscape added a new attribute, ENCTYPE, to the FORM; this attribute enables forms to read file data. Consider the following example:
<FORM ENCTYPE="multipart/form-data" ACTION="/some/URL" METHOD=POST> Send file named: <INPUT TYPE=file NAME=userfile> <INPUT TYPE=submit VALUE="Send File"> </FORM>
The URL named in the ACTION attribute of the form should be a CGI script that's prepared to deal with the file on STDIN. It can do anything with the file that any CGI script can do on that server (save it to disk, parse it, send it somewhere else, and so on).
Like frames, file upload has now been adopted as a standard and is part of HTML 3.2.
Navigator 4.0 can function as both an Object Linking and Embedding (OLE) client and an OLE server. This fact means that you can include OLE documents (such as Microsoft Word documents or Microsoft Excel spreadsheets) in a Web page. You can also bring a Navigator document into an OLE-compliant application.
Apple's Internet suite, Cyberdog, uses a competing component technology called OpenDoc. Versions of OpenDoc are available for all major platforms and OpenDoc is backward-compatible with OLE. So, at some point, Netscape may be tempted to move Navigator to OpenDoc. For now, Netscape has announced that it will build "Navigator for Cyberdog" using OpenDoc technology. Apple will bundle this version of Navigator into future versions of its operating system and make Navigator its default browser.
In late 1996, Cyberdog was largely unknown outside of Macintosh
circles but still accounted for more than five percent of the
browser hits on major Web sites. Cyberdog users point to the fact
that Cyberdog is closely integrated into the Mac operating system
and OpenDoc-compliant applications-a user can be working inside
a word processor or a spreadsheet and seamlessly access a Web
page or send an e-mail message. You can even embed live Internet
content into an OpenDoc-aware application such as ClarisWorks.
Cyberdog users also like DocBuilder, a utility that enables end
users to quickly build CyberDocuments, which provide custom access
to the Internet. These CyberDocuments enable you to embed information
from multiple Internet sources, make new buttons so that you have
single-click access to mail, newsgroups, or Web pages, and provide
live views of Internet sites.
ON THE WEB |
http://cyberdog.apple.com/ If you're a Mac user and you don't yet have Cyberdog, download it by clicking the Download button on this site. For more information, click the General Information button. If you're already using Cyberdog, use this site to get the latest version or to download CyberParts, components to enhance your copy of Cyberdog. Visit http://cyberdog.apple.com/cyberdocs.html for some ideas of how to use CyberDocuments. This page includes links to some award-winning sites that are based on CyberDocuments. If you're not using Cyberdog yet, you'll have to content yourself with http://cyberdog.apple.com/images/startpoint.gif-a graphical representation of a CyberDocument that is viewable in any graphical browser. |
Cyberdog is an OpenDoc application. Before you can install Cyberdog, you need OpenDoc. There's a link on the Cyberdog download page, or you can go there directly by visiting http://www.opendoc.apple.com/users/getod.html.
Microsoft's entry into the browser world, Internet Explorer, is intended to be a Netscape-compatible browser. With a few minor exceptions, such as the MARQUEE tag, Microsoft's extensions duplicate Netscape's extensions. When Microsoft's browser announces its name, it gives Mozilla, the Netscape name, so that CGI scripts that give one page for Netscape and another for other browsers give Microsoft Internet Explorer (MSIE) the same page they give Netscape.
In the short term, Netscape still has twice the market share of Microsoft. In the long term, it's tough to bet against Microsoft. As far as the Webmaster is concerned, all of the comments about Netscape enhancements apply to MSIE 3.0 or later, so once a Webmaster has developed a plan on how to deal with that browser, the plan will also cover MSIE.
Netscape has publically stated its commitment to support standard HTML in Navigator. They participate in the standardization process; many of the tags and attributes in HTML 3.2 appeared first as Netscape extentions.
Notwithstanding, Navigator continues to be ahead of the standardization process. Each release of Navigator offers capabilities that are not part of the Web standard. If you are writing applications for an intranet that uses Navigator or MSIE, you may be able to use all of these enhancements. If your application or site runs on the Internet, you must at least consider non-Netscape browsers and have a plan for delivering your content to them as well.
To learn more about Netscape's view of HTML, and about HTML in general, visit the HTML Reference from the Netscape ONE SDK site at http://developer.netscape.com/library/documentation/htmlguid/.