HTML Hyperlinks | Internal Links in HTML| External Links in HTML | E-mail Links in HTML

HTML Hyperlinks | Internal Links in HTML| External Links in HTML | E-mail Links in HTML

A website is a collection of interconnected web pages. Links creation are an essential part of web design. Links creation properly utilizes the content and reduce the effort for repetition of content. Links can be used to interconnect two different webpages or it may be used as a hyperlink to go to some other URL or we can use a link to navigate in the same webpage.

Internal Links in html

An internal link is used in html page to navigate properly in the webpage. If you want to go to any specific location in the same page by clicking on a link, you can create an internal link in the webpage. <a> tag is used for link creation in html page.

Syntax:

<a href= “#link1”> MyLink</a>

Here “href” contain the location name where the link will navigate us when we click on “MyLink”. The location is given a name for reference and the name contain “#” at the time of creating link.

<a name= “Link1”> my link starts here </a>

This is the place where we will reach on click.

Example:

<! DOCTYPE html>

<html>

<head>

<title> Internal link example </title>

</head>

<body>

<p>Welcome to my webpage. This is an example of internal link creation in html webpage.</p><br>

<a name= “HTML Introduction”> Introduction to Html </a>

<p> Html is hyper text mark-up language.</p><br><br>

<a name= “CSS Introduction”> Introduction to CSS </a>

<p> Cascading Style Sheet is used for styling the web pages</p><br><br>

<a href= “#HTML Introduction”> html</a><br>

<a href= “#CSS Introduction”> css</a>

</body>

</html>


External Links in html

An external link is used to interconnect two html webpages. When you want to navigate to some other page or any other URL by clicking on a link on webpage, external links are created. An external link can be created by using anchor tag in html web page.

Syntax:

<a href= “Pagename.html or URL”> text to be written on link </a>

Here Pagename.html or URL is the name of the webpage or address where link will navigate on click.

Example:

“Page1.html”HTML Hyperlinks | MSA Technosoft

<! DOCTYPE html>

<html>

<head>

<title> This is Page1 </title>

</head>

<body>

<h1> Page 1</h1>

<br>

<a href= “Page2.html”> Back</a>

</body>

</html>

 

“Page2.html”Extrenal hyperlink in html | msa technosoft

<! DOCTYPE html>

<html>

<head>

<title> External link example</title>

</head>

<body>

<h1> this page creates external links in html webpage</h1>

<br>

<a href= https://msatechnosoft.in> URL external link </a>

<br>

<a href= “Page1.html”> Page1 external link</a>

</body>

</html>


Email links in html

We can create an email link in html webpage. If anyone click on that link it will give an option to send an email to the specified email address. This link can be created through anchor tag in html.

Syntax:

<a href= “mailto: e-mail id”> Send email </a>

Example:

<! DOCTYPE html>

<html>

<head>

<title> Email link Example</title>

</head>

<body>

<h1> This page creates an emailing link in html webpage</h1>

<br>

<a href= “mailto:info@msatechnosoft.in”> Send an email </a>

</body>

</html>

Categories:   tech blogs

Comments