LINKS TO OTHER DOCUMENTS ON THE WEB
So, now you have a whole set of pages on your local disk, all linked to each other in some places in your pages, however, you want to refer to page somewhere else on the internet-for example, to the first Caesars page by Dr. Ellis Knox at Boise State University for more information on the early roman emperors. You also can use the link tag to link those other pages on the internet, which I’ll call remote pages. Remote pages are contained somewhere on the web other than the system on which you’re currently working.
The HTML code you use to link pages on the web looks exactly the same as the code you use for links between local pages. You still use the <a> tag with an href attribute, and you include some text to serve as the link on your web page. Rather than a filename or a path in there, however, you use the URL of that page on the web, as Figure 5.5 shows.
FIGURE 5.5 link to remote files.
TASK: EXERCISE 5.2: LINKING YOUR CAESAR PAGES TO THE WEB
Go back to those two pages you linked together earlier today, the ones about the Caesars. The menu. Html file contains several links to other local pages that provide information about 12 roman emperors.
Now suppose that you want to add a link to the button of the menu file to point to the first Caesars page by Dr. Ellis Knox at Boise State University, whose URL is http:// history. Boise state. edu/westciv/Julio-cl/.
First, add the appropriate text for the link to your menu page, as follows:
<p><i> the first Caesars</i> page by Dr.Ellis Knox has more information on these emperors.</p>.
What if you don’t know the URL of the home page for the first Caesars page(or the page to which your want to link), but you do know how to get to it by following several links on several different people’s home pages? Not a problem. Use your browser to find the home page for the page to which you want to link. Figure 5.6 shows what the first Caesars page looks like in a browser.
FIGURE 5.6 the first Caesars page.
NOTE
If your system isn’t connected to the internet, you might want to connect now so that you can test links to pages stored on the web.
You can find the URL of the page you’re currently viewing in your browser in the address box at the top of the browser window. To find the URL for a page you want to link to, use your browser to go to the page, copy the URL from the address field, and paste it into the href attribute of the link tag. No typing!
After you have URL of the page, you can construct a link tag in your menu file and paste the appropriate URL into the link, like this:
INPUT
<p>”<i><a href=http://history .boisestate.edu/westciv/julio-cl/>
The first Caesars </a></i>”page by dr. Ellis Knox has more information on these emperors. </p>
In that code I also italicized the title of the page using the <i> tag. You’ll learn more about that tag and other text formatting tags in Lesson 6, “formatting text with HTML and CSS.”
Of course, if you already know the URL of the page to which you want to link, you can just type in into the href part of the link. Keep in mind, however, that if you make a mistake, your browser won’t be able to find the file on the other end. Many URLs are too complex for humans to be able to remember them; I prefer to copy and paste whenever I can to cut down on the caches of typing URLs incorrectly.
Figure 5.7 shows how the menu. Html file, with the new link in it, looks when it is displayed.
No comments:
Post a Comment