Table Maker3schools TranslateImage CompressorFavicon Icon GeneratorCrop & Resize Image
Apu November 22, 2022 . #Element . #HowTo

How to Insert Hyperlink in HTML Page?

Do you want to know how to insert hyperlink in HTML page? Don't worry we will learn everything about links and how you can insert them into your html pages.

What is a link? #

Basically a link is a connection from one website to another and allows users to click on it to visit that website.

A link does not have to be text. This can be an image or any other HTML element on your web page.

How to create a link to a website? #

To make a hyperlink in an HTML page, use the <a> </a> tag. Whatever text gets added inside this tag, will work as a hyperlink. The most important attribute of the <a> element is the href attribute, which indicates the destination of the link.

HTML Links - Syntax #

<a href="url">link text</a>
  1. href : The href attribute is used to indicate the destination address of the link. "href" stands for Hypertext Reference.
  2. link text : Link text is the part of the link that will be visible to the reader. By clicking on this link text, readers will be redirected to the specified URL address.
The following example shows how to create a link to #
<a href="">Visit</a>

Add an image as a link in HTML page. #

To hyperlink an image we don't need to do anything just use the <img> tag inside the anchor (<a>) tag.

The following example add an image as a link in HTML page. #
<a href="">
  <img src="" height="50" width="50">

HTML Links - The target Attribute #

By default, the linked page will be open in the same window or tab. To change it, you must change its value. The target attribute has four values _self _blank _parent and _top.

The following example will open the linked document in a new window or tab. #
<a href="" target="_blank">Visit</a>

Scroll Down

Write An Answer