HTML links

HTML links connect the current page to the destination resources. These resources may be the other pages of the same website or the external web resources. These links form navigation bar to navigate the other pages.

href (hyper reference) attribute contains the address of external resources.

<a> element

a element defines a link that connects the current page with the other pages of the site. a means anchor between two resources.

text link

We can make text links by using the text as the content of a tag.

Example

<a href="https://www.web4college.com/" title="web4college"> Go to web4college </a>

Try </>

href attribute specifies the address of the linked resource. title attribute defines the nature of the link.

image link

We can also make image links by using the image as the content of a tag.

Example

<a href="https://www.web4college.com/" title="web4college"> <img src="files/logo.png" /> </a>

Try </>

img element adds an image in the page. src attribute specifies the location of the image.

<base> element

base element represents the document base URL. It is the basic URL for all of the links that are empty i.e. links that don't have URL.

Example

<head>
 <base href="http://www.google.com" target="_blank">
</head>

Try </>

link element links the current page to the other documents. link element should be placed in the <head> tag.

Example

<head>
 <link rel="stylesheet" href="files/test.css">
</head> 

Try </>

In the above example, the file test.css styles the div block.



Was this article helpful?