Linking to Other DocumentsNow it's finally time to get to the meat of HTML; time to begin using the features that HTML was created to do. The most significant feature of the web is linking documents together. In fact, that's what makes the web work like a web. You can jump from document to document with no regard of where they are physically located. For example, I could easily create a document which references (links to) other documents in China, Russia, The Library Of Congress and the island of Tonga. If I skillfully pieced these pages together, you might never even know these were different documents. The tag used to link documents together is called ANCHOR, and it's represented in HTML as simply A. The ANCHOR tag has lots of possible arguments and many different functions, which can make it extremely confusing. To create a link to another document you first need to start the ANCHOR and indicate where to proceed if the link is clicked. You then include text, a picture, a multimedia element or some other element to inform the visitor what the link is all about. Finally, you close the tag. An example of a simple link is shown below.
The A begins the tag and the HREF attribute tells the browser which file to display if the link is clicked. The word "Tips" is the text that is displayed in the browser (by default underlined in blue) and the </A> ends the tag. The way this looks is: There are lots of other things that you can do with ANCHOR. To begin with, you can display an image instead of text for the link.
Which is displayed as shown below. Click on the picture and you call the page into the browser. By default, clicking on the link calls the page into the browser window, replacing whatever is there. Sometimes, however, you may want to create a new window. This is done by including the TARGET attribute.
Clicking on this link will create a new window containing the specified page. You can link to any type of object, including sound files, videos, images and even downloadable programs. Some examples are shown below.
|