Hyperlinks are the foundations of the World Wide Web. Hyperlink can be defined a location in the resource that has the address of or it points to another resource or another location in the same resource. With the help of URLs, a browser comes to know where it has to go when you click on a particular link. A URL is nothing but an address that identifies a location in the resource or the resource itself. These resources can be images, videos or other web pages.
When a web page is loaded in the web browser, URLs are used to render the HTML code properly. When a web page is rendered, the browser finds all the hyperlinks associated with the resources. Then it grabs all the resources like images or videos and placed them appropriately in the web page and displays it to the user. If the browser doesn’t know how to handle the resource, it simply opens a dialogue box that let user choose the appropriate tool to process the resource or to save it.
URL stands for universal resource locator. URLs are basically addresses of the resources. A complete URL begins with the protocol identifier. It’s not mandatory to enter the protocol identifier while you are writing a URL in the browser’s address space. A user usually writes the domain name as www.google.com and the browser prepends the protocol identifier to it like http://www.google.com.
http is the most common or primary protocol used over the web. We can say that, http is the way of communication between the computers. It regulates the flow of web pages by using the headers of the protocols. After the protocol identifier server’s name is written. It is followed by the path of the resource and the actual resource name. For example: http://www.abc.com/b/c/d.html.
URLs can be external or internal. An external URL is the one which points to another web site whereas the internal URL points to the resource or location within the same web site. URLs are also classified as absolute URL and relative URL. An absolute URL contains the entire path to the resource. It is usually used when locating the external resources. A relative URL is not complete. It uses the directory structure of the web server to fetch resources which are internal to a web site.
The anchor tag <a> is used to create hyperlinks. It is used to refer locations within the same documents or among different documents. The “href” attribute of the anchor tag is used to create a reference to the other resource.
“<a href=http://www.aa.com/b/c.html> this is a hyperlink </a>”
In the example above, the “href” attribute holds the URL of the resource the hyperlink points to. The text written between the <a> and </a> is what the user will see on the web page. The hyperlinks appear as the purple coloured, underlined text that can be clicked. Usually a mouse pointer changes to a hand tool when moved over the hyperlink.