Every time you click a word that takes you to another page, you are using one of the oldest and most important features of the web: the hyperlink. Links are what turn isolated pages into a connected web of information. Without them, the internet would just be a pile of separate documents with no way to move between them. For anyone learning HTML, understanding how links work is a core skill, because almost every website depends on them for navigation. In this post, we will break down how hyperlinks are built, how the anchor tag works, the difference between relative and absolute addresses, and how to jump to a specific spot within a single page.

Table of Contents

A hyperlink is a connection from one resource to another. The page you are reading is the source, and the page you land on after clicking is the destination. This simple idea is the foundation of the World Wide Web, which is why the “W” in WWW stands for “web” in the first place. Links let users move freely between related pages instead of typing a full address every time.

Links do more than just connect two web pages. According to Mozilla’s developer documentation, a link can point to web pages, downloadable files, email addresses, phone numbers, locations within the same page, or anything else that an address can describe. This flexibility is why hyperlinks are used everywhere, from navigation menus and footers to inline references inside an article.

Good linking also improves how people experience a site. When a long article has clear links to its sections, readers can jump straight to the part they need instead of scrolling endlessly. Search engines also follow links to discover and understand pages, so thoughtful linking supports both users and visibility.

In HTML, every link is created using the anchor element, written as <a>. The letter “a” stands for anchor. On its own, the tag does nothing useful. It needs an attribute called href, which stands for “hypertext reference,” to tell the browser where the link should go. As the W3C specification explains, the href attribute is what makes an anchor a working source for a link.

A basic link looks like this:

<a href=”https://www.example.com”>Visit Example</a>

There are three parts to notice here. The opening <a> tag marks the start of the link. The href value inside the quotation marks is the destination address. The text between the opening and closing tags, “Visit Example,” is the visible, clickable part that users see. This visible text is called the anchor text. The closing </a> tag ends the link.

Writing helpful anchor text

The words you choose for the clickable text matter. A common mistake is using vague phrases like “click here” or “read more.” These tell the user nothing about the destination. Strong anchor text describes where the link leads, such as “download the syllabus” or “view the library catalogue.” This is not just good style. People who use screen readers often pull up a list of all links on a page, so descriptive text helps everyone understand a link even when it is read out of context.

Linking to email and phone numbers

The anchor tag is not limited to web pages. By changing what goes inside href, you can create special links. Using mailto: followed by an email address opens the user’s default email program. Using tel: followed by a number lets mobile users start a call. These are handy on contact pages:

<a href=”mailto:library@example.com”>Email the librarian</a>

Relative and absolute URLs

Once you start linking, you need to understand the two ways of writing an address: absolute and relative. The choice affects how easy your site is to maintain and how reliably your links work.

Absolute URLs

An absolute URL is the complete address of a resource. It includes the protocol, such as https://, the domain name, and the full path to the file. An example is https://www.example.com/courses/html.html. Because it carries every piece of information needed to find a page, an absolute URL works no matter where it is placed. You must use absolute URLs when linking to a page on a different website, since the browser needs the full address to reach another domain.

Relative URLs

A relative URL leaves out the protocol and domain. It only gives the path to a file in relation to the current page. For example, if you are on the home page and want to link to an about page in the same folder, you can simply write:

<a href=”about.html”>About us</a>

Relative paths can also move between folders. A forward slash at the start, like /courses/html.html, points from the root of the site. Two dots, like ../images/logo.png, move up one folder level. Because relative URLs are shorter and assume the same domain, they are the natural choice for internal links between pages on your own site.

Choosing between the two

The practical rule is straightforward. Use relative URLs for links within your own website and absolute URLs for links to external sites. Relative links make a site easier to move and maintain. If you shift your whole project from a testing setup to a live server, relative links keep working without any edits, while absolute links would all need rewriting. The trade-offs between the two mean most developers mix both, picking whichever fits the situation.

Linking between sections of a document

So far, every link has moved you to the top of a new page. But sometimes you want to jump to a specific part of a page instead. This is extremely useful for long documents, single-page websites, and a table of contents. The technique is sometimes called a named anchor or, more accurately today, an in-page link.

How fragment identifiers work

Jumping to a section is a two-step process. First, you give the target element a unique id attribute. The id is a label that must be unique within the page. For example:

<h2 id=”references”>References</h2>

Second, you create a link whose href value is a hash symbol (#) followed by that same id. The hash tells the browser this is a fragment identifier, a pointer to a part of the document rather than a separate page:

<a href=”#references”>Go to references</a>

When clicked, the browser scrolls directly to the element with the matching id. As guides on in-page linking show, this is the standard way to build navigation menus for single-page sites, where each menu item points to a section further down the page.

The older name attribute

In older HTML, sections were marked using an empty anchor tag with a name attribute, written as <a name=”top”></a>. You may still come across this in legacy code. Modern HTML5 has moved away from this method. The recommended approach is to place an id attribute on any element you want to link to, such as a heading, a section, or a div. The id method is cleaner because it works on any element and does not require an extra empty tag.

Jumping to a section on another page

You can combine a page address with a fragment identifier to land on a specific section of a different page. You simply add the hash and id to the end of the URL:

<a href=”catalogue.html#fiction”>See the fiction list</a>

This opens catalogue.html and scrolls straight to the element with the id “fiction.” A popular use of this idea is a “back to top” link. By giving the top of your page an id and linking to it from the bottom, readers can return to the start of a long article with a single click.

Putting it together

Hyperlinks rest on a handful of clear ideas. The anchor tag with its href attribute is the building block. Absolute URLs carry a full address and suit external links, while relative URLs keep internal links short and portable. Fragment identifiers using id values let you move within a single page. Master these, and you can connect any set of documents into a smooth, navigable structure. Add descriptive anchor text, and your links will be useful to every reader, including those using assistive technology.

What do you think? If you were building a study-notes website with very long pages, would you rely more on in-page section links or split the content across many smaller pages? And in what situations might an absolute URL actually be safer to use than a relative one, even for an internal link?

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

References
  1. https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/a
  2. https://www.w3.org/TR/html401/struct/links.html
  3. https://www.conductor.com/academy/urls/faq/absolute-vs-relative/
  4. https://www.dhiwise.com/post/html-relative-link-vs-absolute-whats-the-difference
  5. https://w3htmlschool.com/linking-to-sections-in-html-using-id-and-anchor/
  6. https://html5-tutorial.net/html-basics/links/

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Information Processing & Retrieval

1 Intellectual Organisation of Information

  1. Intellectual Organisation of Information
  2. Meaning of Intellectual Organisation of Information
  3. Why IOI is Necessary?
  4. IOI in Indexing Systems
  5. IOI and Indexing Languages
  6. IOI in User Services
  7. IOI and Content Analysis
  8. Information Retrieval Systems – Changing Environment
  9. Future Trends

2 Indexing Languages–Part I – Concepts and Types, Subject Headings Lists and Thesauri

  1. Indexing and its Types
  2. Indexing Language
  3. Vocabulary Control
  4. Classification Schemes
  5. Subject Headings Lists
  6. Thesaurus
  7. Thesaurofacet
  8. Classaurus
  9. Sears List of Subject Headings
  10. Library of Congress List of Subject Headings

3 Indexing Languages–Part II- Classification Schemes

  1. Dewey Decimal Classification (DDC) Scheme
  2. Universal Decimal Classification (UDC) Scheme
  3. Library of Congress Classification (LCC) Scheme
  4. Colon Classification (CC) Scheme
  5. Bibliographic Classification (BC) Scheme
  6. Library Bibliographical Classification (BBK) Scheme
  7. Broad System of Ordering (BSO) Scheme
  8. Special Classification Systems

4 Indexing Systems and Techniques

  1. Indexing Principles and Process
  2. Pre-Coordinate Indexing Systems
  3. Post-Coordinate Indexing Systems
  4. Automatic Indexing
  5. Non-Conventional Indexing: Citation Indexing
  6. Web Indexing

5 Evaluation of Indexing Systems

  1. Purpose of Evaluation
  2. Levels of Evaluation
  3. Evaluation Criteria
  4. Recall and Precision
  5. Other Performance Measures
  6. Relevance
  7. Evaluation Methodology
  8. Evaluation Experiments

6 Principles and Evolution of Bibliographic Description

  1. Bibliographic Description: An Overview
  2. Scope and Objectives of Bibliographic Description
  3. Evolution of Bibliographic Description
  4. Ranganathan’s Principles
  5. ISBDs
  6. Bibliographic Formats
  7. Electronic Resource Description
  8. Models of Bibliographic Description
  9. Bibliographic Description: Entities, Attributes and Relationships

7 Rules for Bibliographic Description

  1. Bibliographic Description: Its Origin
  2. Development of Anglo-American Code
  3. The International Standard Bibliographic Description (ISBD)
  4. Impact of ISBD on Catalogue Codes
  5. Bibliographic Description for Non-Print Materials
  6. Guidelines for Bibliographic Description of Electronic Resources
  7. Guidelines for Bibliographic Description of Internet Resources
  8. Rules for Description of Electronic Resources in AACR2 Revision 2002

8 Standards for Bibliographic Record Format

  1. International Standard Bibliographic Description (ISBD)
  2. MARC Format
  3. UNIMARC
  4. Common Communication Format (CCF)
  5. Indian Standard

9 Metadata- MARC21-856 Field, Dublin Core, TEI

  1. MARC21 – 856 Field
  2. Dublin Core Metadata Initiative (DCMI)
  3. Text Encoding Initiative (TEI)
  4. Procedure of Electronic Resource Description

10 Norms and Guidelines for Content Development

  1. Introduction
  2. Needs and Guidelines
  3. Standards Related to Electronic Content
  4. W3C Recommendations
  5. Electronic Text Encoding and Interchange
  6. Dynamic Content

11 Introduction to HTML and XML

  1. World Wide Web and Markup Languages
  2. Standard Generalized Markup Language (SGML)
  3. HyperText Markup Language (HTML)
  4. Basic HTML Tags
  5. Linking
  6. URLs
  7. HTML and the Browser
  8. eXtensible Markup Language (XML)
  9. XML Syntax and Semantic Tags
  10. Document Type Definition (DTD)
  11. Implications of XML in Library and Information Activities

12 Web-based Content Development

  1. What can be done with World Wide Web?
  2. Hypertext, Hyperlink, and Hypermedia
  3. Hypertext Markup Language (HTML)
  4. Introduction to Dynamic HTML
  5. Web Interface to Database Linking
  6. Introduction to XML
  7. XML Document Design
  8. Multimedia Web Resources
  9. Web Servers
  10. Website Hosting
  11. Tools for Web Page Designing

13 Multilingual Content Development (Using Unicode)

  1. Character Representation in Computer
  2. American Standard Code for Information Interchange (ASCII)
  3. Indian Scenario and Indian Standard Code for Information Interchange (ISCII)
  4. UNICODE
  5. Web Content Development Through UNICODE
  6. Applications of UNICODE
  7. Applying UNICODE to the Libraries
  8. Problems Associated with UNICODE

14 ISAR Systems- Objectives, Types, Operations and Design

  1. Users and Their Information Needs
  2. Objectives of ISAR Systems
  3. Types of ISAR Systems
  4. Design of ISAR Systems
  5. Evaluation of ISAR Systems

15 Compatibility of ISAR Systems

  1. Need for Compatibility Among ISAR Systems
  2. Scope of Compatibility in ISAR Systems
  3. Areas of Compatibilities in ISAR Systems
  4. Principal Issues of Compatibility in ISAR Systems
  5. Compatibility of Online IR Systems
  6. Approaches Towards Compatibility in ISAR
  7. Quality Control and Compatibility

16 Intelligent Information Retrieval Systems

  1. Introduction
  2. Expert Systems
  3. Expert Systems for Information Processing and Retrieval
  4. Components of Expert Systems
  5. Knowledge Representation
  6. Knowledge Engineering
  7. Artificial Intelligence Based Decision Support Systems (DSS)
  8. Pattern Recognition

17 Information Retrieval Processes and Techniques

  1. Information Retrieval Systems
  2. Databases
  3. Information Retrieval Systems: Purpose, Components, and Functions
  4. Indexing and Information Representation
  5. Vocabulary Control
  6. Searching
  7. Information Seeking and User Interfaces
  8. Web Information Retrieval Systems
  9. Intelligent Information Retrieval

18 Information Retrieval Models and Their Applications

  1. Information Retrieval
  2. Information Retrieval Techniques
  3. Models Based on Input/Output
  4. Models Based on Theories and Tools

19 Search Strategies, Processes and Techinques

  1. Search File – An Essential Component
  2. Search Strategies and Pre-requisites
  3. Search Techniques
  4. The Information Search Process
  5. Online Searching
  6. How the Search Engines Work
  7. Common Search and Retrieval Features of Web Search Engines