Link Tags


Link tags are used to create Hyperlinks in HTML Document and to add other external documents.

1. <a> 


<a> tag defines a hyperlink.

Example :


 <!DOCTYPE HTML>


<html>


<head>


<title> a tag Example </title>


</head>


<body>


<h1> This a element </h1>




<a href="https://www.tutorialsug.com"> Visit tutorialsug.com!</a>


</body>




</html>





Output :

2. <link>


<link> tag the Link Element is used to connect an External Document to an HTML Document.

Example :



<!DOCTYPE html>


<html>


<head>


<title> HTML Link Tag </title>

<link rel ="stylesheet" href = "stylenew.css">


</head>


<style>


#contentinfo p {


          line-height: 20px;


          margin: 30px;


          padding-bottom: 20px;


          text-align: justify;


          width: 140px;


          color : blue;


}


</style>


<body>


<div id = "contentinfo">


   <p> Welcome to our website . We provide tutorials on various subects.</p>


</div>


</body>


</html>



Output :

3. <nav>


<nav> tag defines navigation links.

Example :


 <!DOCTYPE HTML>


<html>


<head>



<title> Nav link Tag </title>


</head>


<body>


<h1> This nav element </h1>


<p>  nav element defines a set of navigation links: </p>

<nav>

    <a href="https://www.tutorialsug.com/2020/04/html_27.html">HTML</a>

     <a href="https://www.tutorialsug.com/2020/04/intoduction.html">SQL</a>

</nav>


</body>


</html>




Output :