Полезная информация

Special Edition Using HTML 4

Previous chapterNext chapterContents

- 8 -
Linking Documents Together

by Mark R. Brown, Jerry Honeycutt, and John Jung

Understanding Hypertext and Hypermedia

Hypertext is a term you'll frequently hear associated with the Web. A hypertext document is a document that contains links to other documents, allowing you to jump between them by clicking the links. It's also a term associated with help files and other types of documents that are linked together. For example, if you've published a report that cites several sources, you can link the references of those sources to related works. Likewise, if you're discussing the migratory habits of the nerd-bird, you can provide links to Web pages where nerd-birds are known to frequent.

Hypermedia is based upon hypertext but contains more than text. It contains multimedia such as pictures, videos, and audio. In hypermedia documents, pictures are frequently used as links to other documents. You can link a picture of Edinburgh to a Web site in Edinburgh, for example. There are countless types of multimedia you can include on a Web page, and some of those can serve as links to other Internet documents and resources. Figure 8.1 shows you an example of a hypermedia document.

FIG. 8.1
Hypermedia documents contain much more than just text. They contain graphics, sounds, and video, too.

Understanding Links

A link really has two different parts. First, there's the part you see on the Web page called an anchor. There's also the part--the URL reference--that tells the browser what to do if you click that link. When you click a link's anchor, the browser loads the file or document given by the link's corresponding URL reference. You learn about both parts of a link in this chapter's following sections.


A link's anchor can be a word, a group of words, or a picture. Exactly how an anchor looks in the browser depends largely on what type of anchor it is, how the user has configured the browser to display links, and how you created it. There are only two types of anchors: text and graphical.

Text Anchors  Most text anchors look somewhat the same. A text anchor is one or more words the browser underlines to indicate the fact that it represents a link. The browser also displays a text anchor using a different color than the rest of the surrounding text (the color and appearance of links are under the author's and user's control). Figure 8.2 shows a Web page that contains three text anchors. In particular, notice how the text anchors on this Web page are embedded in the text. That is, they aren't set apart from the text, like the references in this book, but are actually an integral part of it. Clicking one of these links loads a Web page that is related to the link. Many text anchors are used this way. The HTML for the first text link looks a bit like this (the <A> tag is discussed in "Linking to Documents and Files," later in this chapter):

<A HREF="vero.html">Vogon Earth Reconnaissance Office</A>

FIG. 8.2
You'll find Vogon's Hitch-Hiker's Guide to the Galaxy Page at

Figure 8.3 shows another Web page with a lot of text anchors. These anchors aren't embedded in the text, but are presented as a list or index of links from which you can choose. Web page authors frequently use this method to present collections of related links.

Graphical Anchors  A graphical anchor is similar to a text anchor. When you click a link's graphical anchor, the browser loads the Web page that the link references. Graphical anchors aren't underlined or displayed in a different color, but can be displayed with a border. No two graphical anchors need to look the same, either. It depends entirely on the picture that you choose to use.

FIG. 8.3
List your Web site in Yahoo!.

Versatility is the strong suit of graphical anchors. You can use them for a variety of reasons. Here are some examples of the ways you find graphical anchors used on a Web page:

<A HREF="whatsnew.htm"><IMG SRC="whatsnew.gif" BORDER=0></A>

URL References

The other part of a link is the URL reference. This is the address of the Web page the browser loads if you click the link. Every type of link, whether it uses a text or graphical anchor, uses either a relative or absolute reference.

Relative References  An URL reference to a file on the same computer is also known as a relative reference. That means that the URL is relative to the computer and directory from which the browser originally loaded the Web page. If the browser loads a page at http://www.mysite.com/page, for example, then a relative reference to /picture would actually refer to the URL http://www.mysite.com/page/picture. Relative references are commonly used to refer to Web pages on the same computer.

FIG. 8.4
GolfWeb's home page uses graphical anchors to represent a variety of its pages you can load.

FIG. 8.5
HomeArts is an online magazine that uses sponsors to pay the bills so that the service remains free.

NOTE: Relative references work differently if you use the <BASE> tag in your HTML file. If you do use the <BASE> tag, relative references are always relative to the URL given in the tag. They're not relative to the URL page on which the reference appears. For example:
<BASE HREF="http://www.tuna.com/~mypages">
<A HREF="index.htm">

The link in the second line would refer to http://www.tuna.com/~mypages/index.htm, no matter where the page itself was physically located.

Convenience is the primary reason you use a relative reference. It's much simpler to just type the file name instead of the entire URL. It also makes it easier for you to move Web pages around on the server. Because the URL references are relative to the Web page's computer and directory, you don't have to change all the links in the Web page every time the files move to a different location.

Absolute References  An URL reference that specifies the exact computer, directory, and file for a Web page is an absolute reference. Whereas relative references are common for links to Web pages on the same computer, absolute references are necessary for links to Web pages on other computers.

Linking to Documents and Files

Now that you have the terminology down (anchors, links, relative references, and so on), you're ready to start adding links to your own Web pages. It's very simple. You have to tell the browser what element in the HTML file is the anchor and the address of the Internet document or resource to which you're linking. You do both things with one tag: <A>.

The following example shows you what the <A> tag looks like. This is its simplest form used for linking to another Web page on the Internet. Its only attribute is HREF, which specifies the URL to which you're linking. The URL can be any valid absolute or relative reference, such as http://www.server.com/home/index.htm. Since the <A> tag is a container, you must put the closing </A> tag on the other side of the anchor. That is, the opening <A> tag tells the browser where the anchor (text or graphical) starts and the closing </A> tag tells the browser where the anchor ends. This is an example:

<A HREF=URL>Anchor</A>

The following bit of HTML shows you how to add a text anchor to your HTML file. In this example, HREF references Jerry Honeycutt's home page on the Internet. The anchor, which is underlined in the Web browser, is Jerry Honeycutt's. The text before and after the <A> container isn't part of the anchor and is therefore not underlined. For that matter, nothing happens when the user clicks the text outside the container. On the other hand, when the user clicks Jerry Honeycutt's, the browser loads the home page in the browser. Figure 8.6 shows what this anchor looks like in Internet Explorer.

While you're here, why don't you visit
<A HREF="http://rampages.onramp.net/~jerry">Jerry Honeycutt's</A> homepage

FIG. 8.6
You can control the appearance of links by using the <BODY> tag.

NOTE: The examples you've seen thus far use absolute references. You can also use relative references. Relative references can get a bit out of hand, however, if you store different Web pages in different directories. You'll have a difficult time remembering exactly in which directory an HTML file is stored, and thus, how to formulate the relative reference.

To remedy this problem, you can add the <BASE> tag to the top of your HTML file. In the absence of the <BASE> tag, all relative references are based upon the URL of the current HTML file. Adding the <BASE> tag provides an URL on which all relative references in the HTML file are based. It affects relative references in every HTML tag, including the <A> tag, <IMG> tag, and so on.

Thus, if you add
<BASE HREF="http://www.server.com">

to your HTML file, all relative references are based upon that address, instead of the address of the current HTML file. In this case, the relative reference, images/face.gif, would resolve to http://www.server.com/images/face.gif.
Note that the <BASE> tag's original intention was to provide the URL of the document in which it's found. This allows folks who are viewing the document out of context to locate the document on the Internet. It works perfectly well for the purpose of dereferencing relative URLs, however, and is documented by W3C in this manner.

TIP: Some browsers support ToolTip-style help for links. That is, when the user holds the mouse over a link for a certain period of time, the browser displays the contents of the <A> tag's TITLE attribute in a small pop-up window. Thus, if you want to provide additional information about the link to the user, assign it to the TITLE attribute, like this: <A HREF="page.html" TITLE="Go to page.html">.

The previous example showed you how to create a text anchor. Creating a graphical anchor isn't much different. Instead of enclosing text in the <A> container, you enclose an image. Consider the following HTML, which is similar to the previous example. Figure 8.7 shows what it looks like. The HREF references Jerry Honeycutt's home page, but instead of using a text anchor, it uses the <IMG> tag to create a graphical anchor. When the user clicks anywhere on the picture, the browser opens the Web page referred to by the <A> tag.

<A HREF="http://rampages.onramp.net/~jerry"><IMG SRC="photo.gif"></A>

NOTE: Imagemaps are becoming much more common. They let you map certain portions of an image to different URLs.

FIG. 8.7
If you don't want to display a border around the image, you can add the BORDER attribute to the <IMG> tag, and set its value to 0.

Internal Links

As well as providing links to other HTML files, you can link to an anchor within the current document. For example, you can provide a table of contents for the current Web page at the top of the page. You can then link each entry to a different section within the current Web page.

There are two steps to this. First, you must create an anchor in the HTML file that indicates the location to which you're linking. For example, if you want to provide a link to the middle portion of your Web page, you'd create an anchor in the middle and give it a name using the NAME attribute. You name the anchor so that you can refer to that name in your link. Note that because you're only naming an anchor, instead of creating a link, you don't set the HREF attribute. You still have to use the opening and closing <A> tags, but the browser doesn't highlight the contents of the <A> tag because you're not using it as a link. Here's what the named anchor looks like:

<A NAME=MIDDLE>Middle Section in Web Page</A>

After you've created the named anchor, you create a link to it. You use a special notation to link to that anchor. Instead of setting the HREF attribute to the URL of another Web page, set it to the anchor's name, prefixing the anchor's name with a pound sign (#). Consider the following example. The HREF attribute refers to the named anchor shown in the previous example. The name is prefixed with the pound sign to indicate to the browser that you're making an internal link. When the user clicks Jump to the middle, the browser aligns the anchor in the previous example to the top of the browser window.

<A HREF="#MIDDLE">Jump to the middle</A>

NOTE: Some browsers do not move the named anchor to the top of the browser window if the anchor is already displayed in the window. That is, if your internal link is at the top of the Web page, and the named anchor is displayed somewhere in the middle of the Web page, when the user clicks the internal link, the browser will do nothing.

You can also add a name to most elements using the ID attribute. For example, you can add a name to a Header element like this:

<H2 id=JumpHere>You Can Jump Right To This Header!</H2>

You could then link directly to the name assigned by the ID attribute with this link:

<A HREF="JumpHere">Click Here to Jump to That Header!</A>

Files, Plug-In Content, and So On

When the user clicks a link to another Web page, the browser opens that Web page in the browser window. On the other hand, if the user clicks a link to a different type of document, it downloads the document to the user's computer and then decides what to do with it. One of two things happen as a result:

FIG. 8.8
Linking to a file, GIF, for example, is not the same thing as inserting or embedding that file in your Web page.

TIP: Digital Infoworks sells a product called Cyberlinks that you can use to create links in any OLE-enabled product, such as Wordpad. This means you can create hypertext links in your documents just like you can in your Web pages. For more information, see http://www.pioneersys.com.

FIG. 8.9
You can cause the browser to play AVI files inline by embedding them, instead of linking to them.

The LINK Element

Whereas the <A> tag is used to create hyperlinks that a user can follow when he or she wants to, the LINK element is used to connect various resources to an HTML document. Style sheets, color palettes, international versions of the document, scripts, indexes, notices--all can be tied to an HTML document using the <LINK> tag. One simple way to look at it is to think of the <A> tag as a link for readers of an HTML document, whereas the LINK tag is a resource for creators of that document.

One basic application for the <LINK> tag is to link a document to a style sheet, like this:

<LINK REL=stylesheet MEDIA=screen HREF="OurStyle.css">

This line would link the document to the style sheet "OurStyle.css" for display on a monitor screen. You can find out more about style sheets in Chapter 17, "Applying Cascading Style Sheets."

The <LINK> tag can also be used to define a document's relationship to another document. For example, if your document was a section of Chapter 4 in an HTML hyperbook, that might be indicated with this line of code:


The document "Chapter4TOC.html" would be the table of contents that linked to the current document, and the LINK tag indicates that it is the parent document to the one you're reading. Note that the <LINK> element doesn't display anything in the browser window--it's simply there as a reference tool for you and for search engines and Webcrawler robots.

The "Chapter4TOC.html" file used in the previous example would contain the following line:

<LINK REV=Chapter HREF="OurDoc.html">

The REV attribute indicates the reverse relationship from the REL attribute. That is, it shows that a page is "superior" to the referenced document.

REV and REL attributes can take just about any value, though there is some ongoing effort to create some standardized values to make relationships between documents clearer. Here are some of the proposed values for REV and REL:
Value Indicates
Parent Parent document
Index Index document
Previous Previous page
Next Next page
Contents Contents page
Alternate Alternate version
Begin Beginning page

A value of Alternate indicates that the referenced document is an alternate version of the current page. This can be for a version for print, for example, or even a page in an alternate language. In this case, you'd add an additional attribute, LANG, to show the language of the linked version. For example, the following would indicate an alternate page in French:

<LINK REL=alternate HREF=FrenchDoc.html LANG=fr TITLE="Paris">

The initial example a few paragraphs back used the value MEDIA=screen to indicate that the stylesheet being linked to was for display on a video screen. It could have just as easily said MEDIA=print to indicate a print version.

Linking to Other Net Resources

The World Wide Web is a popular part of the entire Internet, but many others resources are available. Most of them were around long before the Web was even born and, as a result, they have a lot of stuff on them. Also as a result of the Web's newness, the other resources sometimes have a much wider audience base. Whether you're designing a home page for yourself or for your company, you may want to know how to link to those resources.

These resources can take various shapes, from the peanut gallery that is Usenet news, to personal e-mail, to the capability to access other computers through Telnet. Although you can create your own versions of these resources using forms, most of the time you wouldn't want to do so. For example, you could easily create a page with many HTML form tags, text elements, and a submit button for e-mail, but simply creating a link to e-mail with a particular address would be easier. This way, you can more easily update the page because you don't have to worry about which forms to read. Also, sometimes browsers have built-in support for some of the other resources, giving the user faster response time.

You especially want to create links to other resources on the Net if you're already using a resource. If you already have a Gopher site with information that's updated automatically, why rebuild it to fit the Web? Just adding a hyperlink to your Gopher site makes more sense. Similarly, if you're running a BBS that's on the Internet, putting in a Telnet link to it makes more sense. There's no reason for recreating, or even mirroring, your BBS through forms for the Web.

Creating a Link to E-Mail

The single most popular activity on the Internet is sending e-mail. More people use e-mail than any other resource on the Net. The reason is quite simple: If you're on the Internet, you have an e-mail address. The provider that gives you access to the Net often has at least one e-mail program available for your use. Most modern e-mail programs offer a friendly interface, with no complex commands to learn.

You'll most likely want to put in an e-mail link when you want people to give you feedback on a particular topic. Whatever it is you want comments on--be it your home page or your company's product--if you want to know what people think, use an e-mail link. E-mail links are also useful for reporting problems, such as a problematic or missing link. Typically, the Webmaster of a particular site should put these types of links to him or herself. You really have no reason not to put in a link to your e-mail address.

Creating a link to an e-mail address is similar to creating a link to another home page. The only difference is the reference for your anchor element. Normally, you put a link to a home page around some text as in the following:

<A HREF="http://www.mycom.com/myhome.html">Go to my home page</A>.

Linking to e-mail is just as simple. Instead of entering http:, which specifies a Web address, use mailto: to specify an e-mail address. Instead of specifying an URL, put in your full e-mail address. The preceding example now looks like this:

<A HREF="mailto:me@mycom.com">Send me E-mail</A>.

The link created with the preceding HTML looks like any other hypertext link. You can easily mix and match hyperlinks to different resources, and they'll all look the same (see Figure 8.10). When this link is selected, the browser opens its own e-mail interface for the user. Each interface is different, but most of them automatically get your e-mail address and real name, and prompt you for a subject.

Because the e-mail link is a standard URL and easily implemented, many browsers have built-in support for it. As a result, when people click an e-mail link, the Web browser will put up a primitive mail program. A few companies offer a full set of Internet applications, from an e-mail program, to a newsreader, to a Web browser. Oftentimes, these work in conjunction with each other. Consequently, when you click an e-mail link, these Internet packages start up their own e-mail programs (see Figure 8.11).

FIG. 8.10
E-mail links look just like regular hypertext links.

FIG. 8.11
Internet Explorer launches its own full-featured e-mail program when you click an e-mail link.

Creating a Link to Usenet News

Usenet is one of the best--or worst--resources on the Net, depending on whom you ask. Anybody with an opinion can tell you what he or she thinks. They may not know what they're talking about, but they'll let you know their opinion. Usenet is the ultimate embodiment of the freedom of speech, letting everybody say anything they want.

The opportunity for anybody, anywhere on the Net to have a voice could be an asset to your home page. Often, you may want to put in a link to Usenet when you want people to read for more information. If your home page has some information about HTML authoring, for example, you might want readers to go to a particular newsgroup for more help. You can also include such a link so people can see what the differing opinions are. If you have a certain political view and want others to see what the opposition is, a Usenet news link would be helpful.

Creating a link to a Usenet newsgroup is pretty simple; this kind of link is also just a derivative of the basic hypertext link. As you did with the e-mail link, you need to modify two parts in the anchor reference. When you're creating a Usenet link, enter news: instead of http:. Likewise, instead of specifying a particular URL, put in a specific newsgroup, as follows:

For more information, see
<A HREF="news:news.newusers.questions">news.newusers.questions</A>.

As you can see in Figure 8.12, the Usenet news hyperlink looks identical to other links. When a user selects such a link, the browser tries to access the user's Usenet news server. If the news server is available to that person, the browser goes to the specified newsgroup. The user can then read as much as he or she likes in that particular group.

FIG. 8.12
Usenet news links allow you to make a point to people interested in your topic.

CAUTION: When a user clicks a Usenet news link, his or her browser tries to access the newsgroup in question. Because it's this user's browser and environment, he or she might not have access to the group you specified. Not all Internet providers have access to the same newsgroups. When you're creating such links, be mindful that not everybody will necessarily be able to access them.

How a Usenet hyperlink is handled is left entirely up to the Web browser the person is using. Many of them treat each article in a newsgroup as an individual hyperlink. Often, there's little in the way of sophisticated newsreading features. Some companies such as Netscape and Microsoft offer an entire suite of programs, including a Usenet newsreader (see Figure 8.13). In these cases, the newsreader of that suite is started.

Making FTP Available on Your Site

Another popular activity is accessing an FTP site. FTP, or File Transfer Protocol, allows users to copy files from other computers (the FTP site) onto their own computers. This popular method allows companies to distribute their demonstration software or patches to their products.

Putting in a link to an FTP site allows users to get a specific file from a particular location. This capability is useful for companies and shareware authors in making their products available. This type of link is also great for people who review software, allowing them to let users get the files being reviewed. People who have files (such as FAQs and interesting pictures) that they want others to get to easily might want to put in a link to an FTP site.

You create a link to an FTP site the same way you create other links, and they look the same, too (see Figure 8.14). Enter ftp: instead of the usual http:, and change the URL address to //sitename/path. Simply put, the site name looks the same as the URL address. You need to make sure the site name you specify points to a machine that accepts anonymous FTP connections. FTP links are almost always supported by the browser natively. You can create a typical FTP link as follows:

You can get the FAQ <A HREF="ftp://ftp.mysite.com/pub/FAQ">here</A>.

FIG. 8.13
When a Usenet link is accessed, some sophisticated Web browsers start up their own newsreader.

FIG. 8.14
An FTP link allows many people to access a particular file.

If you don't specify a particular file name, the browser lists the files in the directory you specified. This is particularly useful if you want the user to have access to multiple files. Programs available on multiple machines, or large files broken up into several chunks, typically fall into this category.

Technically speaking, there isn't too much of a difference between FTP and the Web. As a result, Web browsers support FTP links without needing another program. The browsers gives you a list of the files in the current directory, and indicates which are directories and which are files (see Figure 8.15). If you click a directory, it changes into that directory. If you click a file, the browser directly downloads the file.

FIG. 8.15
Web browsers have no problems handling FTP links by themselves.

TROUBLESHOOTING: Some people can't access some of my FTP links. If a lot of people are reporting inaccessibility to some of your FTP links, try finding other sites. This error usually comes up when you have an FTP link to a particularly busy FTP site. You should try to locate other (less busy) FTP sites that have the same file to which you're pointing.

NOTE: By default, when FTP links are activated, the FTP connection that's made is known as anonymous FTP. This means that the FTP site the user is trying to access doesn't care who the user is. All the anonymous FTP site cares about is sending and receiving files to anybody who logs in with the username "anonymous." The password is often the user's e-mail address, but this isn't necessary. Anonymous FTP allows software companies and the like to distribute their products to a very wide audience.

A nonanonymous FTP is where the FTP site is very particular about who can access it. To get access to a nonanonymous FTP site, you must have an account on the FTP site itself. Basically, you can't get into a nonanonymous FTP site unless you're already in. This is probably the most widely used FTP site around, as many companies allow employees to FTP into their own accounts.

NOTE: You can easily change an anonymous FTP link into a nonanonymous one. Simply put a username and an at symbol (@) sign before the site name. This causes most Web browsers to automatically attempt to log in as username. The browser then prompts the user for the password for the login ID.

Linking Your Home Page to a Gopher Site

Before there was the World Wide Web, there was something known as Gopher. It was originally designed by the University of Minnesota (the Golden Gophers) as a way of making information that was spread out easily available. Gopher has probably been the Internet resource most affected by the Web, often being superseded by it. The biggest difference between Gopher and the Web is that it is very difficult for individual people to create their own Gopher sites or holes.

Although Gopher sites are not as prevalent as they once were, they still have a strong following. You can typically find Gopher sites at places that dispense a lot of automated information. Although the site could have easily been converted to HTML, it simply hasn't bothered. This conversion of Gopher data into usable HTML code is typically the work of a programmer, and often not worth the effort. Putting in an HTML link to a Gopher site allows people browsing your page easy access to a great deal of information.

You can create a link to a Gopher hole by modifying the same two elements of the anchor reference. Change the http: to gopher:, and change the URL to //sitename. The site name must be a valid Internet host name address. The link created looks like every other type of hypertext link, and built-in support is provided by most Web browsers. A Gopher hole link usually looks something like the following:

For more information, go <A HREF="gopher://gopher.mysite.com">here</A>.

Just like FTP, Gopher is a Net resource that is built into HTML. Consequently, most Web browsers support any links to a Gopher site internally. That is, you don't need a Gopher- specific application to go to a Gopher site, the browser takes care of it for you. But also just like FTP, the built-in support for Gopher is often very bland (see Figure 8.16).

FIG. 8.16
There's only so much a Web browser can do to liven up the text-based Gopher resource.

Providing Access to a Large Database with a WAIS Link

WAIS stands for Wide Area Information System, which basically means "lots of large databases you can search through." WAIS was specially designed by WAIS Corporation as a way of accessing large amounts of information. This capability is very different from what Gopher and the Web do in that WAIS was intended to cover very large chunks of information. Typically, databases that contained several million entries were considered appropriate for WAIS.

WAIS is typically accessed through a search engine because most people don't want to plod through such large stores of information. When WAIS was first introduced, custom front ends allowed easy access to a WAIS database. With the advent of the Web, however, most WAIS databases now have HTML front ends to their databases. Now you can simply fill out a Web form and click a button, and the WAIS search is underway.

You can create a link in your home page to a WAIS database as easily as you do with all the other links. You have to modify the same two anchor reference elements to hold the correct information. Instead of using http:, enter the prefix wais:, and change the URL location to the address of a WAIS database:

To search for a number in your area, click 
<A HREF="wais://wais.mysite.com">here</A>.

NOTE: Most browsers don't have built-in support of WAIS database searches. If you put in a link to one of these databases, be sure to include some sort of reference to where users can get a WAIS client. Of course, if the WAIS database you're pointing to has HTML forms support, you don't need to worry about including such information.

Accessing Remote Computers with Telnet Links

The capability to access other computers is not something new to the Web; it's been around for a long time. This access has always been achieved with a UNIX program called Telnet, which doesn't stand for anything in particular. Telnet allowed people to try to log into a remote machine, much the same way some people access their Internet providers. The Web allows for support of accessing remote machines through a Telnet link to a remote computer.

Usually, people trying to get on a secure system are the people for whom you want to provide a Telnet link. People who provide access to a private, Internet-accessible BBS will most likely want to put in a Telnet link. Also, companies that offer a BBS for customer support may want to make use of link to a Telnet site. Generally speaking, for most home pages, you have little or no reason to include a link to a remote site.

As you might have guessed, creating a Telnet link to a remote site requires modifying the anchor reference element. You change the http: to telnet:. You also need to change the URL part of the anchor reference to hostname. Hypertext links that refer to Telnet sites look the same as other links. A typical Telnet link takes the following form:

Click <A HREF="wais://wais.mysite.com">here</A> to access our BBS.

NOTE: Web browsers do not support Telnet activity natively. They typically depend on an external application to talk correctly to the remote machine. If you put in a link to Telnet to another site, be sure to also include some reference to a Telnet client.

NOTE: There are a few operating systems that have built-in Telnet capability. Among the OSs that have this are Windows 95, Windows NT, and UNIX.

Even though Telnet is a rather simple Net resource, it also has some problems. Among the many problems are issues of how to display the remote session and how to interpret keypresses. As simple as these problems may appear, they're hard to implement in a Web browser. For these reasons, most Web browsers don't have support for Telnet. Rather, they leave it up to the individual to find a Telnet program and set it up (see Figure 8.17).

FIG. 8.17
Most Web browsers don't support the Telnet links internally, so you need another program to access these links.

TIP: Some Web browsers allow something extra in the anchor reference. Simply add the username you want the person to log on as, followed by the @ symbol, before the site name. Instead of

Access my <A HREF="telnet://mysite.com/">system!</A>

you can have

Access my <A HREF="telnet://john@mysite.com/">system!</A>

On those browsers that support this, the Web browser pops up a little notice. This notice tells the user what login name should be used to access the system.

How Links Work Together

You may be wondering how well these hypertext links work with each other. The answer is "Very well." Even though the links are different, they all look and behave the same. This common behavior exists because of the anchor reference that all hyperlinks use. Some may need client programs not built into a Web browser, but that's not a big deal. This identical look and feel of various hypertext links allows home pages to have a consistent feel. Consistency in a home page is important because it allows people to intuitively know they're in your home page without looking at the current URL.

The best thing you can do is to treat all hypertext links in the same manner, with slightly different formats. Just take the same basic anchors, add a reference, and put in the correct pointer to that reference (see Table 8.1). As a Web author, you must always remember that each person looking at your home page could be using any browser available. No hard and fast rules about what resources all browsers will support even exists. Whatever resource you want to link to, though, try to include a link to a location where the user can get a client.

Table 8.1  Sample Formats for Creating Links

Link To What to Use Sample Link
Web page http://sitename/ http://www.mysite.com/
E-mail mailto:address mailto:me@mysite.com
Newsgroup news:newsgroupname news:news.newusers.questions
FTP ftp://sitename/ ftp://ftp.mysite.com/
Gopher gopher://sitename/ gopher://gopher.mysite.com/
WAIS wais://sitename/ wais://wais.mysite.com/
Telnet telnet://sitename/ telnet://bbs.mysite.com/

Previous chapterNext chapterContents

© Copyright, Macmillan Computer Publishing. All rights reserved.