Adding a Link to a Webpage You can create a hyperlink at any time when developing a webpage. The trick is to make sure that the page is stored in the correct location. For example, if you include a link to a filename without a path to the file, the browser will look in the current folder for that file. If the file is stored somewhere else, the browser won’t be able to load it. This situation represents a common problem when creating hyperlinks. A good way to avoid problems is to test the hyperlink by opening the source page in a browser, and then clicking the hyperlink to make sure that it opens the correct page. After you publish the HTML document to the server, you should do the same testing to make sure that the page still opens correctly. Chief Silva created the page for the self-defense for the elderly class, and now you want to create a hyperlink that links your page to her page. The file containing the webpage for the self-defense for the elderly class is saved in the Module.08\Module folder. To create a hyperlink to a file: 1 Switch to your text editor. 2 Click the insertion point to the right of the first opening
  • tag in the bulleted list, and then type the opening tag for the hyperlink, which includes a hyperlink to the file elder_sd.html: 3 Click to the right of the word “Elderly” on the same line, and then type the closing tag for the hyperlink, . Figure 8-13 shows the HTML document. Figure 8-13 Hyperlink added to the HTML document 4 Save the file, switch to your browser, and then reload the page. The first item in the bulleted list is formatted as a hyperlink. For most browsers, the default formatting for a hyperlink is underlined, blue text. 5 Click the Self-Defense for the Elderly link. The Self-Defense for the Elderly page opens in your browser. Trouble? If the elder_sd.html page does not open, then the files for the target and source pages are not stored in the same folder. Move the files into the same folder, reopen the source page (women_sd.html) in your browser, and then click the hyperlink. 6 Click your browser’s Back button to return to the women_sd.html page.