Inserting Hyperlinks on an HTML web page

Links in an HTML web page helps in linking one page to another. For example, below we have some links:

Hyperlinks Example

Above, the text “Python Dictionay”, “Python Tuples”, “Java”, Python” are all Hypelinks. On clicking, the respective link, the linked page will open.

To add a hyperlink, use the <a></a> tag and the href attribute,

<a href="">Learn Programming</a>

Whatever text comes inside the <a>…</a> tag becomes hypelink. For example, above the text “Love Programming” becomes a link.

Under the above <a> tag, we will add the link. Following is how you can add a hyperlink correctly in HTML:

<a href="https://studyopedia.comn/tutorials">Learn Programming</a>

The <a>…</a> tag should always come inside the <body>…</body> tags.

Example

Following example gives an overview of how to add links to an HTML web page,

<!DOCTYPE html>
<html>
   <head>
      <title>HTML Links Example</title>
   </head>
   <body>
      <h2>Tutorials</h2>
      <a href="/tutorials/drupal-commerce">Drupal Commerce</a>
      <a href="/tutorials/prestashop">Prestashop</a> 
      <a href="/tutorials/java">Java</a> 
      <a href="/tutorials/cpp">C++</a> 
   </body>
</html>

Output

Links in HTML

Image height and width attribute in HTML
Why head tag is used in HTML
Studyopedia Editorial Staff
contact@studyopedia.com

We work to create programming tutorials for all.

No Comments

Post A Comment