HTML Links - Hyperlinks

HTML links are hyperlinks.

HTML links and hyperlink that links one page to another page. It will create the hyperlinks to other web pages as well as files, location, or any URL. The "href" attribute is the main attribute of the HTML tag.

The syntax of HTML anchor tag is define below.

<a href="https://exampot.com/" taget="_blank" >Visit TestHike</a>

We can use an image as a link

Example :

<a href="sample.html" >
<img src="fruits_basket.jpg" alt="Fruits Basket" style="width:200px;height:160px;">
</a>
  Try it Yourself

Use link to an email address

Example :

<a href="mailto:[email protected]">Mail to Example User</a>
  Try it Yourself

We can also use button as a link

Example :

<button onclick="document.location='sample.html'">sample html page</button>
  Try it Yourself