What is a Link in HTML?
An HTML link is used to connect one web page to another. Links help users navigate on the internet.
The link is created using the anchor tag <a>.
Syntax
<a href="URL">Link Text</a>Here
- <a> → anchor tag
- href → destination address
- Link Text → clickable text
<a href="https://learnsyntax.com">Go to LearnSyntax</a>Human Body Example
- <a> tag is like hands
- Hands help us go somewhere or connect
- Links connect pages
Types of Links
External Link (Other Website)
<a href="https://www.learnsyntax.com">Learn Syntax</a>Internal Link (Same Website)
<a href="about.html">About Us</a>Email Link
<a href="mailto:info@example.com">Send Email</a>Phone Link
<a href="tel:9546805580">Call Now</a>Open Link in New Tab
Use target="_blank".
<a href="https://learnsyntax.com" target="_blank">Learn Syntax</a>| Value | Meaning |
| _self | Same tab (default) |
| _blank | New tab |
Title Attribute (Extra Info)
<a href="home.html" title="Go to Home Page">Home</a>Important Points
- href is mandatory
- Attributes are written in opening tag
- Multiple attributes can be used together
