Introduction to Anchors and Links
HTML presents several conventional idioms for structured documents and rich texts. However, its features for the interactive documents and hypertext separate it from the others. Link is also known as Web link or hyperlink. It is a connection from a web resource to another one. The concept is quite simple but links are a major force which drives the success of the web. A link would have a direction and two ends which are known as anchors. The link would start at a source anchor and it would point to a destination anchor which can be any type of web resource.
Uses of Link
One of the most common uses of a link is to retrieve any other type of web resource. However, the author can also insert links in the documents which express the relationship between different resources rather than just activating the link in order to visit the resource. The links which express relationships would have more than one link types specified in the source anchor.
Specification of Links and Anchor
Links are anchors are both very easy concepts to understand. Though many HTML attributes and elements create links to different resources like the FORM or the IMG element, there are anchors and links which are created by the A and the LINK elements as well. The LINK elements can appear only at the head of the document. On the other hand, the A element would appear only in the body. When the href attribute in A element is set, the element would define a source anchor for the link which can be activated by the user in order to retrieve any web resource. The source anchor would be the location for the A instance and the web resource would be the destination anchor. The retrieved resource can be handled by a user in many ways, by opening an HTML document in the same window, opening an HTML document in a new window or starting the new program for handling the resource etc. the A element has images, text and content, hence the user might have to render the content in a way so that the presence of the link would be indicated.
Internationalization
Quite a lot of links could point to the documents which have been encoded with character encodings, hence the LINK and A elements support the charset attribute which allows the author to instruct the users about the data encoding at the link’s other end. The hreflang provides the users with all the information about the resource’s language like the lang attribute which provides information about the language which is used in the content and attribute values.
With the knowledge of the basic concepts about links and anchors, users would be able to avoid making several mistakes. They can locate resources which are necessary for the right presentation for the document and they would also be able to warn users that the document would be unreadable because of several reasons.