HTML Links

HTML Links

The links in HTML document can be added by using the following method:

<A> HREF = “asd.html”> links </A >

Where asd.html is the name of another HTML document and links is the link of this document. This is written in between the tag <A> and the ending tag </A>. HREF is an attribute.

The element that marks the text hyper link is called an A or anchor element and the text that is marked, is called a hypertext anchor. The text that is written between the tag <A> and </A> is often called as the hot text. In the browsers the hot text appears with an underline, and it is also in different colors, mostly the color is blue. For example

<A HREF = “”> Facebook </A>

Results as the following:


In the above example, you can see that the hot text or the text that is written between the tags <A> and </A> is blue and underlined. Clicking on this button will cause the browser to access this internet source.

You can also use images as hypertext anchors.

The link element

The link element is used to describe the relationship between the document and other documents or objects. You might use the links to relate indexes and glossary or sometimes different versions of the same document. The link element is empty that is it does not contain any elements inside it.

And the link element can be inside a Head element only. Link element is optional. Link element can also be used to point towards the previous section of a document which saves the time of the viewer. This concept is used in the navigation buttons that navigate through the whole document. An HTML document can have many links; there is no limit for the number of elements that a document can use.



<link href= “file.html” rel =”next”

title = “title of related document”>

<link href= “/cgi-bin/indexer” rel = “index”>


In above example the first link indicates that the indicated document is the next document to visit in some series of documents. And also gives the title of document. The second link is used to indicate that the linked document is an index of the current document.