If you already know how to build a text-based HTML hyperlink to a web page outside your own web space, you can skip this lesson.
In the last lesson, we used hyperlinks to point to a "local" file, so-called because it resides in the same directory as the file which contained the link. In this lesson, we want to demonstate the use of embedded hyperlinks to create links to other web sites, or to a specific file at another web site. Once again, the HTML "anchor" tag pair will implement the link for us. In fact, we'll use it exactly as we did with local files, except that we'll use the full URL for our anchor tag reference.
Let's look at three (3) examples. In the first, we'll link to a local file, using the simple file name. In the second, we'll link to the same file using the full URL. In the third, we'll link to a SITE, "Maddog 'N' Miracles" (my homepage).
<A HREF="demopag2.htm">Click here</A> to view our demo page (referenced by simple file name). <P> <A HREF="http://www.io.com/~maddog/html-for-real-people/demopag2.htm">Click here</A> to view our demo page (referenced by full URL). <P> <A HREF="http://www.io.com/~maddog/">Click here</A> to visit "Maddog 'n' Miracles" (use your browser's "back" button to return to this page).
Click here to view our demo page (referenced by simple file name).
Click here to view our demo page (referenced by full URL).
Click here to visit "Maddog 'n' Miracles" (use your browser's "back" button to return to this page).
Notice how the reference portions of each demonstrated link differ. The first and second demo links point to the same file, but the embedded reference takes different forms. In fact, when the browser formulates its message to the HTTP server, requesting the file pointed to by the link, the message will contain the same (full) URL in both cases. In the third demo, the link reference points to a directory or web site, with no filename at all. In this case, the HTTP server will automatically return the default HTML file, usually the "home page".