How to add a link in text in HTML

Overview

HTML lets users navigate through the web pages using HTML links. One of the options that HTML provides to users is to add links to text.

Syntax

The <a> tag is used for creating a link in HTML, followed by the href property containing the redirected path.

Any text occurring between the opening and closing of this tag acts as a link to a URL.

  • HTML
Text link in HTML

Types of links in HTML

HTML caters to two types of links:

Absolute links

Links that require the complete URL of a web page are known as absolute links. These are the pages that are usually considered external to the website. In the examples below, target represents the way a link opens in the browser.

<a href="https://www.google.com" target="_blank">Absolute Link Text.</a>

Relative links

Links that are local to the website are known as relative links. These usually refer to web pages that are already present in the directory in which the website resides.

<a href="home.html" target="_blank">This text will redirect the user to the home page of the website.</a>

Title property

The title property provides additional information related to the link used in href. This information is visible when the mouse hovers on the link.

  • HTML
Adding additional information to the link

Free Resources

Copyright ©2025 Educative, Inc. All rights reserved