A link instructs the web browser to get a service, from a named computer, within a named location on that computer and at a named point within the file thus located. A link is usually executed by clicking on the link with the mouse with the current webpage being replaced with the contents of the linked Web service. A link may consist of four distinct parts.
- "#section1" specifies the named point, or fragment name, within the above file.
- "/html/links.html" specifies the file location, or directory path, on the above computer.
- "www.treeleaves.org.uk" specifies the computer.
- "http://" specifies the type of web service.
Links are incorporated within or between webpages, by specifying anchor points. Such an anchor point can be a destination or source anchor. The <a> and </a> tags define an anchor. A local fragment is a place marker or bookmark within a webpage. The fragment identifier is specified by using the name attribute within an anchor tag. The name of the tag is prefixed with a #, when it is included within a URI.
The top of the webpage is displayed if no fragment identifier is included.
The following code shows the HTML for a link, which is within this document.
This is Tag 1
.Go to Tag 1
Links can be made to text files, which can then be opened.
The following is the code for linking to a text file.
Links can be made to directories, the contents of which can then be displayed.
The following is the code for linking to a directory.
Links can be made to image files, which can then be opened.
The following is the code for linking to an image.