Course Content
Project file
0/1
Complete Web Designing Course for Beginners

Hyperlinks & Navigation

🌐 Connecting Web Pages and Creating Navigation Menus in HTML


🎯 Learning Objectives

After completing this lesson, students will be able to:

βœ… Understand what hyperlinks are

βœ… Create clickable links

βœ… Link webpages together

βœ… Open links in a new tab

βœ… Link external websites

βœ… Link internal webpages

βœ… Create navigation menus

βœ… Build multi-page websites


πŸ“– Introduction

Imagine you are visiting a website.

You click:

Β 
About Us
Β 

and suddenly another page opens.

Then you click:

Β 
Contact Us
Β 

and a different page appears.

Have you ever wondered:

πŸ€” How are pages connected?

πŸ€” How does one page open another?

The answer is:

πŸ”— Hyperlinks

Hyperlinks are one of the most important features of the World Wide Web.

Without hyperlinks:

❌ No website navigation

❌ No Google Search Results

❌ No YouTube Recommendations

❌ No connected webpages

The entire internet works because webpages can link to each other.


🌍 What is a Hyperlink?

A hyperlink is a clickable element that takes users from one location to another.

A hyperlink can open:

βœ… Another webpage

βœ… Another website

βœ… A document

βœ… An image

βœ… An email

βœ… A section within the same page


🏠 Real Life Example

Imagine reading a book.

At the end of a chapter:

Β 
Go to Page 50 for more information.
Β 

You move to another page.

Similarly:

Hyperlinks help users move between webpages.


πŸ”— HTML Anchor Tag

Hyperlinks are created using:

Β 
<a>
Β 

This is called:

Anchor Tag


Basic Syntax

<a href="URL">Link Text</a>

Understanding the Syntax

<a>

Anchor Tag


href

Hyperlink Reference

Specifies destination.


Link Text

Text visible to users.


Example

<a href="https://www.google.com">
Visit Google
</a>

Output

A clickable link:

Β 
Visit Google
Β 

When clicked:

Google opens.


🌐 Linking External Websites

External links point to other websites.

Example:

<a href="https://www.youtube.com">
Visit YouTube
</a>

Another Example

<a href="https://www.wikipedia.org">
Visit Wikipedia
</a>

Practical Example

<!DOCTYPE html>

<html>

<head>

<title>External Links</title>

</head>

<body>

<h1>Useful Websites</h1>

<a href="https://www.google.com">
Google
</a>

<br><br>

<a href="https://www.youtube.com">
YouTube
</a>

</body>

</html>

🎯 Expected Output

Β 
Useful Websites

Google

YouTube
Β 

Both links are clickable.


πŸ“‚ Linking Internal Pages

Internal links connect pages within the same website.

This is one of the most important concepts in web design.


Example Website Structure

Β 
website/

β”‚

β”œβ”€β”€ index.html

β”œβ”€β”€ about.html

β”œβ”€β”€ contact.html
Β 

Homepage

File:

index.html

Code:

<a href="about.html">
About Us
</a>

What Happens?

When clicked:

about.html

opens.


Example

Suppose we have:

index.html

<h1>Home Page</h1>

<a href="about.html">
About Us
</a>

about.html

<h1>About Us</h1>

<p>
Welcome to our website.
</p>

Now both pages are connected.


🌟 Creating Multiple Links

Example:

<a href="index.html">Home</a>

<br>

<a href="about.html">About</a>

<br>

<a href="contact.html">Contact</a>

Output

Β 
Home

About

Contact
Β 

πŸ”₯ Opening Links in a New Tab

By default:

Links open in the same tab.

Sometimes we want:

A new browser tab.


Target Attribute

Use:

target="_blank"

Example

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

Google

</a>

Result

Google opens in a new tab.


🎯 Why Use New Tabs?

Useful when linking:

  • External Websites
  • References
  • Documentation

This prevents users from leaving your website.


πŸ–ΌοΈ Making Images Clickable

Images can also be hyperlinks.


Example

<a href="https://www.google.com">

<img src="logo.png">

</a>

Result

Clicking image opens Google.


πŸ“§ Email Links

HTML can open email applications.


Syntax

<a href="mailto:example@gmail.com">
Send Email
</a>

Example

<a href="mailto:info@example.com">
Contact Us
</a>

Result

Email application opens automatically.


πŸ“ž Phone Number Links

Useful for mobile devices.


Example

<a href="tel:+919876543210">
Call Now
</a>

Result

Clicking the link starts a phone call on supported devices.


🎯 Navigation Menus

Almost every website contains:

Β 
Home

About

Services

Contact
Β 

This is called:

Navigation Menu


Simple Navigation Menu

<a href="index.html">Home</a>

<a href="about.html">About</a>

<a href="services.html">Services</a>

<a href="contact.html">Contact</a>

Output

Home About Services Contact

Better Navigation Menu

<ul>

<li><a href="index.html">Home</a></li>

<li><a href="about.html">About</a></li>

<li><a href="services.html">Services</a></li>

<li><a href="contact.html">Contact</a></li>

</ul>

Output

β€’ Home

β€’ About

β€’ Services

β€’ Contact

πŸ—οΈ Building a Simple Multi-Page Website

Let’s create:

Homepage

About Page

Contact Page


Step 1

Create:

index.html

Code:

<h1>Home Page</h1>

<a href="about.html">
About
</a>

<br>

<a href="contact.html">
Contact
</a>

Step 2

Create:

about.html

Code:

<h1>About Us</h1>

<p>
We provide web designing courses.
</p>

<a href="index.html">
Home
</a>

Step 3

Create:

contact.html

Code:

<h1>Contact Us</h1>

<p>
Email: info@example.com
</p>

<a href="index.html">
Home
</a>

Result

Three connected webpages.

Congratulations!

You have built a mini website.


🌟 Absolute vs Relative Links


Absolute Link

Contains complete URL.

Example:

<a href="https://www.google.com">
Google
</a>

Relative Link

Contains local file path.

Example:

<a href="about.html">
About
</a>

Difference

Absolute Link Relative Link
Full URL Local File
External Websites Internal Pages
Starts with https:// File Name
Internet Required Local Files Work

⚠️ Common Beginner Mistakes


Mistake 1

Missing href Attribute

Wrong:

<a>Google</a>

Correct:

<a href="https://www.google.com">
Google
</a>

Mistake 2

Incorrect File Name

Wrong:

<a href="abot.html">
About
</a>

File doesn’t exist.


Correct:

<a href="about.html">
About
</a>

Mistake 3

Forgetting Quotes

Wrong:

<a href=https://www.google.com>

Correct:

<a href="https://www.google.com">

πŸ† Mini Project – Student Navigation Website

Create:

index.html

<h1>Student Website</h1>

<a href="about.html">
About Me
</a>

<br>

<a href="contact.html">
Contact Me
</a>

about.html

<h1>About Me</h1>

<p>
I am a web designing student.
</p>

<a href="index.html">
Home
</a>

contact.html

<h1>Contact Me</h1>

<p>
Email: student@example.com
</p>

<a href="index.html">
Home
</a>

πŸ“ Practical Activity

Create:

Home Page

About Page

Contact Page

Connect them using hyperlinks.

Test all links.

Verify:

βœ… Home Opens

βœ… About Opens

βœ… Contact Opens


πŸ“‹ Assignment

Assignment 1.6

Answer the following:

  1. What is a hyperlink?
  2. Which tag creates hyperlinks?
  3. What is the purpose of href?
  4. How do you open links in a new tab?
  5. What is the difference between absolute and relative links?
  6. How do you create an email link?
  7. Create a navigation menu containing Home, About, and Contact.

🧠 Quiz

Q1. Which tag creates hyperlinks?

A. <link>

B. <a>

C. <href>

D. <nav>

βœ… Answer: B


Q2. Which attribute specifies link destination?

A. target

B. src

C. href

D. alt

βœ… Answer: C


Q3. Which value opens links in a new tab?

A. _self

B. _new

C. _blank

D. _page

βœ… Answer: C


Q4. Which link type is used for another website?

A. Relative Link

B. Internal Link

C. Absolute Link

D. Local Link

βœ… Answer: C


Q5. Which protocol creates email links?

A. email:

B. mail:

C. smtp:

D. mailto:

βœ… Answer: D


πŸ“Œ Lesson Summary

βœ… Hyperlinks connect webpages together.

βœ… HTML uses the <a> tag for hyperlinks.

βœ… The href attribute specifies the destination.

βœ… Links can connect external websites and internal webpages.

βœ… Navigation menus are built using hyperlinks.

βœ… target="_blank" opens links in a new tab.

βœ… Email and phone links can also be created using hyperlinks.

βœ… Hyperlinks are one of the most important features of the web.

Scroll to Top