TGViewer
Web Development Web Development @webdevcoursefree ยท 79.6K subscribers
Post #4081 309
๐ŸŒ Web Development Roadmap โ€” Part 16

HTML Links โ€” Tag

Links are one of the most important parts of the web. They allow users to move from one page or website to another.

1. Creating a Link

HTML uses the
<a> (anchor) element to create links.



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


The browser displays:

Visit Google

When the user clicks it, the browser navigates to the specified URL.

2. The href Attribute

href stands for Hypertext Reference.

<a href="https://example.com">Visit Website</a>


Here:

<a> โ†’ Creates the link

href โ†’ Specifies where the link goes

URL โ†’ Destination

Text โ†’ What the user clicks

3. Linking to Another Page

Suppose your project contains:

my-website/
โ”œโ”€โ”€ index.html
โ”œโ”€โ”€ about.html
โ””โ”€โ”€ contact.html


From index.html:

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

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


These are called relative links because they point to files within your website.

4. Linking to Another Website

You can also link to an external website:

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


The complete URL is used for an external destination.

5. Opening a Link in a New Tab

You can use target="_blank":

<a href="https://www.example.com" target="_blank">
Visit Website
</a>


This tells the browser to open the destination in a new browsing context, commonly a new tab.

For external links, it's also good practice to use:

<a
href="https://www.example.com"
target="_blank"
rel="noopener noreferrer">
Visit Website
</a>


6. Email Links

You can create a link that opens the user's email application:

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


7. Telephone Links

You can create a clickable phone link:

<a href="tel:+911234567890">
Call Us
</a>


This is especially useful on mobile websites.

8. Linking to a Section on the Same Page

You can jump to a specific section using an id.

<a href="#contact">Go to Contact</a>

<h2 id="contact">Contact Me</h2>


The flow is:

Click "Go to Contact"

โ†“

Find id="contact"

โ†“

Jump to that section

9. Navigation Menu Example

A simple website navigation could look like:

<nav>
<a href="index.html">Home</a>
<a href="about.html">About</a>
<a href="projects.html">Projects</a>
<a href="contact.html">Contact</a>
</nav>


This creates the foundation of a website's navigation.

10. Link vs Button

This is important.

Use a link when the user is going somewhere:

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


Use a button when the user is performing an action:

<button>Submit</button>
More from @webdevcoursefree
  1. Oct 12, 2026For example: Go to Profile โ†’ <a> Submit Form โ†’ <button> Open Article โ†’ <a> Delete Accountโ€ฆ
  2. Oct 12, 2026๐Ÿš€ ๐—ช๐—ต๐—ถ๐—ฐ๐—ต ๐—ง๐—ฒ๐—ฐ๐—ต ๐—ฆ๐—ธ๐—ถ๐—น๐—น ๐—ช๐—ถ๐—น๐—น ๐—ฌ๐—ผ๐˜‚ ๐— ๐—ฎ๐˜€๐˜๐—ฒ๐—ฟ ๐—ถ๐—ป ๐Ÿฎ๐Ÿฌ๐Ÿฎ๐Ÿฒ? Want to builโ€ฆ
  3. Oct 9, 2026Post #4079
  4. Oct 9, 2026Post #4078
  5. Oct 9, 2026Post #4077
  6. Oct 9, 2026Post #4076
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook โ†’Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 โ†’