html anchor hyperlink tag code example

Example 1: how to use link tag in html

<!DOCTYPE html>
<html>

   <head>
      <title>HTML link Tag</title>
      <link rel = "stylesheet" href = "stylenew.css">
   </head>

   <body>
      <div id = "contentinfo">
         <p>Welcome to our website. We provide tutorials on various subjects.</p>
      </div>
   </body>

</html>

Example 2: html anchor tag

The <a> tag defines a hyperlink, which is used to link from one page to another.

The most important attribute of the <a> element is the href attribute, which indicates the link's destination.

By default, links will appear as follows in all browsers:

1. An unvisited link is underlined and blue
2. A visited link is underlined and purple
3. An active link is underlined and red
  
Creating a link to programmingquest.com:
  <a href="https://www.programmingquest.com">Visit ProgrammingQuest</a>

Tags:

Html Example