Sams Teach Yourself HTML 4 in 24 Hours

Sams Teach Yourself HTML 4 in 24 Hours

By Dick Oliver

Linking Between Your Own Pages

When you create a link from one page to another page on the same computer, it isn't necessary to specify a complete Internet address. If the two pages are in the same directory folder, you can simply use the name of the HTML file:

<a href="pagetwo.htm">click here to go to page 2.</a>

As an example, Figures 3.4 and 3.6 show a quiz page with a link to the answers page in Figures 3.5 and 3.7. The answers page contains a link back to the quiz page.

03fig04.gif

Figure 3.4 Because this page links to another page in the same directory, the filename can be used in place of a complete address.

03fig05.gif

Figure 3.5 This is the answers.htm file. Figure 3.4 is quizzer.htm, to which this page links back.

03fig06.gif

Figure 3.6 This is the quizzer.htm file listed in Figure 3.4 and referred to by the link in Figure 3.5.

03fig07.gif

Figure 3.7 Click here for answers in Figure 3.6 takes you here. Click here for the questions on this page is a link back to the page shown in Figure 3.6.

Using filenames instead of complete Internet addresses saves you a lot of typing. More importantly, the links between your pages will work properly no matter where the pages are located. You can test the links while the files are still on your computer's hard drive. You can then move them to a computer on the Internet, or to a CD-ROM or DVD disk, and all the links will still work correctly.

Share ThisShare This

Informit Network