HTML Links And Anchors

The spidery name of the web got its plentiful connections between the websites. All these connections are done with anchor tags and for creating links. Links can also be done with images, text and forms. While building HTML links, there are some categories that would define different kinds of linking. The HREF or Hypertext Reference indicates about reference link. This is basically where the user is directed to the link when they click on the link. All hypertext references can be categorized in to three basic structures the internal, local and Global. Let’s check their functions in brief:

  • In internal links the links anchor the current page
  • The local links other pages within the same domain
  • In global links to other domain outside the site

The examples of the above would be:

1
2
3
Internal - href="#anchorname"
Local - href="../pics/picturefile.jpg"
Global - href="http://www.howtorefinanceyourmortgage.net/"

The links are basically the address for the document on the web. The Hyperlinks can point out to any resources on the web and that can be an HTML page, an image, a sound file or a movie. The HTML anchor element is <a> and this defines both the anchors and hyperlinks. The link syntax will look like:

1
<a href="url">Link text</a>

The start tag contains the attributes to the links and all the element contents define the part that is to be displayed. The href attribute on the other hand, defines the link “address” and that is represented by

1
<a href="http://www.howtorefinanceyourmortgage.net/">How To Refinance Your Mortgage</a>

In HTML links another important aspects are the target attribute and the name attribute. The target attribute explain the link where the document will be opened and this can be done by following the code:

1
<a href="http://www.howtorefinanceyourmortgage.net/" target="_blank">How To Refinance Your Mortgage</a>

The Name attribute is used with <a> element that defines a named anchor inside the HTML document. However, the named anchor is not displayed in a simple way rather they remain invisible to the reader. The named anchor text looks like the following:

1
<a name="label">Any content</a>

The link syntax to the named anchor will be:

1
<a href="#label">Go To Any content</a>

It is necessary to add trailing slash to the subfolder references. If you are linking the link href=”http://www.yahoo.com/html”, you will be able to generate two HTTP requests to the server. This because the server will be adding the slash to the address and will create a new request like “href=http://www.yahoo.com/html/”

All named anchors in HTML links are used for building the table of contents and they do it at the beginning of any large document. All chapters in the document are given with named anchor and all links to the anchors are placed at the top of the document. Even if the browser is not able to find the named anchor, then it is displayed at the top of the browser but no errors are occurred in the process.

Here are few of the common HTML link s which are used by all and are popular in application. For HTML emails links:

1
<a href="mailto:email@zigzag.com?subject=Feedback">Email@zigzag.com</a>

For HTML download Links:

1
<a href="http://www.zigzag.com/pics/htmlT/blanktext.zip">Text Document</a>