|Adding links to your web pages brings out the wonder of the information age. The "Anchor Tag". The Anchor Tag creates links to any file available on the Internat/Intranet, as long as you know the path name i.e, Search Google. You can also create a link to a specific place on a web page using the Anchor Tag with the "id" attribute.||<a href="path/filename.ext"> Visit My Web Page</a>|
<a href="http://www.google.com" target="new">Search Google</a>
<a href="#top">Top of Page</a>
The Anchor Tag on its own is not all that useful. The programmer (you) must assign the Anchor Tag with attributes and values.
All content between the <a></a> becomes the clickable link or hot spot. The hot spot by default will be an underlined blue text where the cursour turns into the A click of the mouse on the link loads the associated file onto the users computer. Keep in mind that "all" content between the <a> and </a> becomes the hyperlink, so it is important to use the closing tag </a> where the clickable link (hot spot) should end.
In this example a small image was used as a visual link to a larger version of the same image. Here is how it was done.
ABSOLUTE URL FOR THIS PAGE:
RELATIVE URL FOR THIS PAGE:
RELATIVE URL FOR THIS IMAGE:
Links can be created that link to different areas of the same page. These links are most often refered to as book marks. A book mark is made by using the name attribute.
The bookmark that was created using the name attribute is not displayed by the browser program. This bookmark is a target that is pointed to by using the href attribute.
Creating a hyperlink to this target you would use the following code.
Pointing to a target (bookmark) on the same page.
<a href="#top">Top of page</a> Points to <a name="top"></a>
Pointing to a target (bookmark) on a different page (relative URL)
<a href="links.htm#top">Top of page</a> Points to <a name="links.htm#top"></a>
Pointing to a target (bookmark) on a different page (absolute URL)
<a href="http://www.homespunhtml.net/html_primer_2015/links.htm#top">Top of page</a>