SA-21/06, C-11, Asapur, Varanasi, UP support@kamaldnp.com +91 8318013442
HTML
1. HTML Introduction: What is HTML? Learn with Examples 2. Best Free HTML Editors: Notepad to VS Code for Beginners 3. HTML Basic Structure: Doctype, Head, Body Explained 4. HTML Elements Explained: Tags, Content & Empty Elements 5. HTML Attributes List: href, src, alt, width, title & More 6. HTML Headings h1 to h6: Which Heading Tag to Use When 7. HTML Paragraphs: p Tag, br Line Breaks & pre Text 8. HTML Style Attribute: Colour, Font Size & Alignment 9. HTML Text Formatting Tags: bold, italic, mark & More 10. HTML Comments: How to Add Notes & Hide Code in HTML 11. HTML Colors: Names, HEX, RGB & HSL Colour Codes 12. HTML CSS: Inline, Internal & External Stylesheets 13. HTML Links: a Tag, href, New Tab & Email Links 14. HTML Images: img Tag, src, alt, Width & Formats 15. HTML Favicon: Create & Add a Browser Tab Icon 16. HTML Title Tag: How to Write a Good Page Title 17. HTML Tables: table, tr, th, td, colspan & rowspan 18. HTML Lists: ul, ol, dl & Nested Lists Explained 19. HTML Block vs Inline Elements: div, p, span Explained 20. HTML Div Tag: Group Content & Build Page Layouts 21. HTML Class Attribute: Style Many Elements at Once 22. HTML id Attribute: Unique IDs, Links, CSS & JavaScript 23. HTML Iframes: Embed YouTube, Maps & Pages in HTML 24. HTML JavaScript: script Tag, Clicks & First Example 25. HTML File Paths: Relative vs Absolute Paths Explained 26. HTML Head Element: title, meta, charset & viewport 27. HTML Layout: header, nav, main, footer Page Structure 28. HTML Responsive Design: Viewport, Images & Media Queries 29. Semantic HTML Tags: header, nav, main, article & footer 30. HTML Forms: input, label, select, checkbox & Submit 31. HTML Entities: & < > © with Examples 32. HTML Audio & Video Tags: controls, source & Fallback 33. HTML Accessibility: alt Text, Labels, Landmarks & ARIA 34. HTML Meta Tags & SEO: charset, viewport, OG Tags 35. HTML Quotations: blockquote, q, cite, abbr & address
Final Test — Certificate ₹10
Try this code live
Lesson 13 of 35

HTML Links: a Tag, href, New Tab & Email Links

3 min read · Free · No login needed

Links are what make the web a web. The <a> tag (short for anchor) creates a link, and the href attribute says where it goes. The text between the tags is what the visitor clicks.

Diagram — see how it fits together
Infographic: parts of an HTML link

Types of links

  • External link — to another website: <a href="https://kamaldnp.com">KAMALDNP</a>. Always use the full address starting with https://.
  • Internal link — to another page on your own site: <a href="about.html">About Us</a>. Use a relative path, no domain needed.
  • Link to a section — to an element with an id on the same page: <a href="#contact">Jump to Contact</a>.
  • Email link — opens the visitor's email app: <a href="mailto:support@kamaldnp.com">Email Us</a>.
  • Phone link — starts a call on mobile: <a href="tel:+918318013442">Call Us</a>.

Opening a link in a new tab

Add target="_blank" and, for safety, rel="noopener": <a href="https://example.com" target="_blank" rel="noopener">Open in new tab</a>. Use this for external links, so your visitor does not leave your site. For links inside your own site, let them open in the same tab.

Link text matters

Write link text that describes the destination: "Download the BTEUP syllabus" is good; "click here" is bad. Google reads link text to understand what the linked page is about, and screen-reader users often jump from link to link without reading the surrounding words.

Tip: You can put an image inside a link to make the image clickable — just place the <img> tag between the <a> tags.

What a link is

A link, or anchor, is created with the <a> tag. It turns text (or an image) into something clickable. The href attribute holds the destination. Without href, the <a> tag is just plain text — it looks like a link but does nothing.

Link attributes

AttributeValueDescription
hrefa web address or pathWhere the link goes. Required.
target_blank, _self_blank opens a new tab; _self is the default, same tab.
titletextA small tooltip shown when you hover over the link.
downloadfile name (optional)Downloads the target instead of opening it.
relnoopenerSecurity setting — use it with target="_blank".

Links can point to many things. Here are four common kinds:

<a href="https://kamaldnp.com">Our website</a>
<a href="about.html">About page</a>
<a href="#contact">Jump to the contact section</a>
<a href="mailto:support@kamaldnp.com">Email us</a>
Note: When a link opens in a new tab with target="_blank", always add rel="noopener". Without it, the new page can reach back and control your page through JavaScript — a real security risk.
Tip: Write link text that makes sense on its own. "Download the HTML syllabus (PDF)" is good. "Click here" is bad — it tells a screen reader user nothing, and it tells Google nothing about the page it points to.

Common mistakes

  • Forgetting the closing </a> — everything after it becomes one giant link.
  • Using "click here" as link text — describe the destination instead.
  • Opening every link in a new tab — only external links usually deserve _blank.
  • Linking to a page with a wrong file name — HTML file names are case-sensitive on most servers.

Example explained

  • <a href="https://kamaldnp.com">KAMALDNP Academy</a> is an external link — the full address starting with https:// takes the visitor to another website.
  • <a href="about.html">About Us</a> is an internal link — a short relative path that points to another page on the same site.
  • <a href="#contact">Jump to Contact</a> jumps to the <h2 id="contact"> further down the same page, instead of loading a new page.
  • <a href="mailto:support@kamaldnp.com">Email Us</a> opens the visitor's email app with the address already filled in.
  • The <br> after each link puts the next link on a new line, so the links stack vertically instead of running together.

Example

Example
<!DOCTYPE html>
<html>
<head>
<title>Links</title>
</head>
<body>

<a href="https://kamaldnp.com">KAMALDNP Academy</a><br>
<a href="about.html">About Us</a><br>
<a href="#contact">Jump to Contact</a><br>
<a href="mailto:support@kamaldnp.com">Email Us</a>
<h2 id="contact">Contact</h2>
<p>Reach us any time.</p>

</body>
</html>

Output

Output — how it looks in the browser
Output of HTML Links: a Tag, href, New Tab & Email Links

Try it yourself — live editor

Change the code below and press Run to see the result instantly. No file to save, no login needed.

Result

Frequently asked questions

The questions learners ask most about this lesson — read the question, then open it to see the answer.

1. How do you create a link in HTML?

Use the a tag with an href attribute; the text between the tags is what the visitor clicks.

2. What is the difference between external and internal links?

External links use a full address starting with https, while internal links use a short relative path to another page on your own site.

3. How do you open a link in a new tab safely?

Add target blank and rel noopener. Use this for external links, so your visitor does not leave your site.

Why learn this yourself — and not just ask AI?

AI can write code for you, but it cannot think for you. When you learn HTML yourself, your brain builds the real skill: you understand why a page looks the way it does, you can fix it when it breaks, and you can answer it in an exam or an interview without help. That is the skill that gets you a job — not a copied answer.

Get certified — just ₹10

Finish all 35 lessons, pass the test (80%), pay ₹10 and get your certificate.

Take the test

Prefer watching? Video courses teach the same topics step by step.

Go further with a full course

Free tutorials teach you the basics. Our paid courses add live projects, mentorship and a certificate.

CapCut Mobile Video Editing Course Beginner to Advance
₹99
View
Summer Training in Python Programming 2026
₹3,000
View
Website Design & Development Workshop 2026
₹299
View
Browse all courses
HTML — Lessons
1. HTML Introduction: What is HTML? Learn with Examples 2. Best Free HTML Editors: Notepad to VS Code for Beginners 3. HTML Basic Structure: Doctype, Head, Body Explained 4. HTML Elements Explained: Tags, Content & Empty Elements 5. HTML Attributes List: href, src, alt, width, title & More 6. HTML Headings h1 to h6: Which Heading Tag to Use When 7. HTML Paragraphs: p Tag, br Line Breaks & pre Text 8. HTML Style Attribute: Colour, Font Size & Alignment 9. HTML Text Formatting Tags: bold, italic, mark & More 10. HTML Comments: How to Add Notes & Hide Code in HTML 11. HTML Colors: Names, HEX, RGB & HSL Colour Codes 12. HTML CSS: Inline, Internal & External Stylesheets 13. HTML Links: a Tag, href, New Tab & Email Links 14. HTML Images: img Tag, src, alt, Width & Formats 15. HTML Favicon: Create & Add a Browser Tab Icon 16. HTML Title Tag: How to Write a Good Page Title 17. HTML Tables: table, tr, th, td, colspan & rowspan 18. HTML Lists: ul, ol, dl & Nested Lists Explained 19. HTML Block vs Inline Elements: div, p, span Explained 20. HTML Div Tag: Group Content & Build Page Layouts 21. HTML Class Attribute: Style Many Elements at Once 22. HTML id Attribute: Unique IDs, Links, CSS & JavaScript 23. HTML Iframes: Embed YouTube, Maps & Pages in HTML 24. HTML JavaScript: script Tag, Clicks & First Example 25. HTML File Paths: Relative vs Absolute Paths Explained 26. HTML Head Element: title, meta, charset & viewport 27. HTML Layout: header, nav, main, footer Page Structure 28. HTML Responsive Design: Viewport, Images & Media Queries 29. Semantic HTML Tags: header, nav, main, article & footer 30. HTML Forms: input, label, select, checkbox & Submit 31. HTML Entities: & < > © with Examples 32. HTML Audio & Video Tags: controls, source & Fallback 33. HTML Accessibility: alt Text, Labels, Landmarks & ARIA 34. HTML Meta Tags & SEO: charset, viewport, OG Tags 35. HTML Quotations: blockquote, q, cite, abbr & address
Final Test — Certificate ₹10

🤖 KAMALDNP AI Assistant

Ask about courses, website & more

Hi! I'm KAMALDNP AI Assistant. Ask me about our courses, website features, or anything else! 😊
Please wait 5s...
🤖 KAMALDNP Assistant ✕

Request human callback:

🔐 Login Required
✕

Please log in to download. You will stay on this page after logging in!

New here? Register now →