HTML me Hyperlinks aur Navigation

Hyperlink ka matlab hota hai ek aisa link jo ek webpage se doosre webpage ya website ko connect karta hai. Jab aap hyperlink par click karte hain, to aap kisi dusri jagah ya page par pahunch jaate hain.

Anchor Tag (<a>)

HTML me hyperlink banane ke liye <a> tag ka use hota hai. Iske sath href attribute diya jata hai jisme link ki destination URL hoti hai.

Simplest Hyperlink Example:

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

Jab koi user "Google" par click karega, tab browser usko Google ki website par le jayega.

Hyperlink ke Prakar

Example : Different Types of Links

<!-- Absolute URL -->
<a href="https://www.google.com" target="_blank">Google</a>

<!-- Relative URL -->
<a href="about.html">About Us</a>

<!-- Anchor Link -->
<a href="#section1">Jump to Section 1</a>

<!-- Email Link -->
<a href="mailto:someone@example.com">Send Email</a>

Navigation ke liye Anchor Links

Aap web pages me alag-alag sections ko id attribute dekar anchor links bana sakte hain jise click karke user turant us section pe ja sake.

<!-- Page ke kisi section me -->
<h2 id="section1">Section 1</h2>

<!-- Link jo us section me jaye -->
<a href="#section1">Section 1 par jao</a>

Link ka Target Attribute

target attribute specify karta hai ki link ka page kahan open hoga — current tab me ya nayi tab me. Example:

<a href="https://www.google.com" target="_blank">Google new tab me khulega</a>

Important Link Attributes

Images Ko Link Banana

Aap kisi image ko bhi hyperlink bana sakte hain. Iske liye <img> tag ko <a> tag ke andar rakhen:

<a href="https://www.example.com">
  <img src="image.jpg" alt="Example Image" />
</a>