The name of the lanuage Hypertext Markup Language, explains it all. The whole original point of HTML was to share ideas through documents that were interconnnected enough that they allowed you to investigate new ideas.
Hypertext links are the heart and soul of HTML. They come in two varieties:
1. Intrapage Links
2. External Links
Intrapage links allow a user to navigate within a webpage. They are more commonly known as anchors. We use anchors to connect to pieces of information within the context of a page.
For example, lets say you had a webpage about the Constitution. At the top of the page you might have an outline which listed each of the titles of the sections of the document. The user, by clicking on the part of the outline that they are interesting in viewing, could navigate directly to that specific portion of the webpage by clicking on the title in the outline.
Here is the syntax for an anchor link
This is the actual link that you would click on.
<a href=#one>Take me to Section 1</a>
This is where clicking on that link would bring you. Ordinarily these two lines of code would not appear right next to each other or there would be no reason for an anchor!
<a name=one>Section 1</a>
***Be aware that you can link either forwards or backwards in a document.***
External links are links to other webpages. These can be other pages within your website or links to another website entirely. External links are coded in one of two ways. They are either coded as relative links or absolute links.
A relative link gives only the name of the HTML page that is being called. An absolute link gives the complete web address of the page being called.
Here is the basic syntax for an external link:
This is a relative link:
<a href="yourpage.html">Go To Your Page</a>
This is an absolute link:
<a href="http://www.yourpage.html">Go To Your Page</a>
Which kind of link should you use?
A relative link is usually used for links that will take people from one place to another within your website. Some online hosts do not seem to work well with relative linking so sometimes it is easier just to type out the absolute address.
If you separate pages into folders you can still make a relative link:
<a href="../folder1/yourpage.html">Go To Your Page</a>
<a href="folder1/yourpage.html">Go To Your Page</a>
<a href="folder1/subfolderA/yourpage.html">Go To Your Page</a>
An absolute link will always take you to the right page as your as you entered the EXACT and COMPLETE web address into the linking statement.
| (<< Back) | [Home] | (Next >>) |