Topics in this sectionCreating web pages using HTML4 topics
HTML links, also called hyperlinks, are clickable text or images that take users from one web page to another. Links are what make the World Wide Web connected — without them, you would have to type a new address every time you wanted to visit a different page.
In HTML, links are created using the anchor tag, written as <a>. The letter "a" stands for "anchor." Everything between the opening <a> and closing </a> tags becomes clickable.
The basic structure of an HTML link is:
<a href="URL">Link text</a>
- href stands for "Hypertext REFerence" — it tells the browser where the link should go.
- URL is the web address of the page you want to link to.
- Link text is the visible, clickable text that the user sees.
For example:
<a href="https://www.google.com">Visit Google</a>
This displays "Visit Google" on the page. When clicked, it opens Google's website.
Internal Links
Internal links point to pages within the same website. When linking to pages in the same folder, you can use just the filename.
<a href="about.html">About Us</a>
If the file is in a subfolder, include the folder name:
<a href="pages/contact.html">Contact Page</a>
External Links
External links point to websites outside your own. These always start with http:// or https://.
<a href="https://www.necta.go.tz">Visit NECTA</a>
It is good practice to add target="_blank" when linking to external sites so the link opens in a new browser tab:
<a href="https://www.necta.go.tz" target="_blank">Visit NECTA</a>
Email Links
You can also create links that open the user's email program with a pre-filled recipient address. Use mailto: followed by the email address:
<a href="mailto:info@school.ac.tz">Email the School</a>
Imagine you are creating a simple website for a student club at your school in Dar es Salaam. Here is an HTML page with all three types of links:
<!DOCTYPE html>
<html>
<head>
<title>Science Club</title>
</head>
<body>
<h1>Welcome to the Science Club</h1>
<p>Learn more <a href="about.html">about our club</a>.</p>
<p>Check out the <a href="events.html"> upcoming events</a>.</p>
<p>Visit the <a href="https://www.moe.go.tz" target="_blank">Ministry of Education</a> website.</p>
<p>Contact us at <a href="mailto:science@school.ac.tz">science@school.ac.tz</a>.</p>
</body>
</html>
In this example:
- "about our club" and "upcoming events" are internal links
- "Ministry of Education" is an external link that opens in a new tab
- The email address opens the student's email app
- Use descriptive link text instead of "click here" — it helps users and search engines understand where the link leads.
- Always check that your links work by testing them in a browser.
- When using external links, consider adding
target="_blank"so users do not lose their place on your page. - Make sure email links use the correct email address.
In Tanzania, small businesses and schools often create simple websites to share information. For example, a market vendor in Arusha could create a webpage listing available fresh produce and include a link to the vendor's WhatsApp number or email address so customers can place orders. By learning to create HTML links, students can help local shops, schools, and community groups build useful web pages that connect people to services and information they need.
How you'll be assessedProcess assessment · Outcome assessment · Knowledge assessment
Process assessment
- Identify types of links (internal, external, email).
- Add hyperlinks using the tag.
- Set attributes (href, target, title).
- Test links in the browser.
- Troubleshoot and correct broken links.
Outcome assessment
Web pages containing correctly functioning internal and external links are created.
Knowledge assessment
Detailed knowledge of:
Method used: The student should explain how to:
- Create HTML links.
Principles: The student should explain the concept of hyperlinking.
Theories: The student should explain:
- Types of links (e.g. internal, external, email).
- The link tags
Circumstantial knowledge: Detailed knowledge about:
- Attributes affecting link behavior.
Question
What does the abbreviation href stand for in an HTML anchor tag?
Sign in to submit your answer and have it count toward your mastery.
Sign in to practiceTutor
Stuck? Ask me anything about this topic.
Sign in to ask the Sonza AI Tutor about this question.
Sign in to askDiscussions
No questions yet