You can link to more than just other people's Web sites. You can use the same HRef attribute to link to email addresses for other pages of your own Web site, or even to other files on your own computer. The hyperlink to point to another file (second.htm) on my own computer, for example, is shown in the following code. In this example, the second.htm file is stored in the same directory as the page linking to it. Please <a href="second.htm">click here</a> to open my second Web page. If, however, my second.htm file was stored in another directory (for example, the Links directory), the hyperlink would need to include the directory name too, as in the following: Please <a href="links/second.htm">click here</a> to open my other page. Tip
The HRef attribute changes slightly if you want to link to a file that is not part of your Web site. You need to tell the Web browser that the file is not located on the Web server. You can see how that is accomplished in the following example: <a href="file:\\servername\foldername\filename.extension"> Click here</a> to open my favorite file. If I want to link to my dogs.doc file in the 4legs folder of my animals server, for example, my hyperlink looks like the following: <a href="file:\\animals\4legs\dogs.doc">click here</a> to open my favorite file. Caution
You also can link to an email address by using the mailto prefix, as shown in the following code line. When you click on the words click here, an email window that enables you to type your message to Mickey Mouse appears. <a href="mailto:mickey.mouse@disney.com">Click here</a> to send mail to Mickey. |