Skip to main content

Command Palette

Search for a command to run...

Anchor tag and its attributes in HTML

Updated
2 min read
Anchor tag and its attributes in HTML
A

I am working as freelancer. I am a experienced full stack web developer. My lovely stack is MERN but I am open for new tech. I love to work with teammates for achieve goals. I love researches to find specific new things.

Html में कई वेब पेजों को एक दूसरे से जोड़ने के लिए <a> tag प्रयोग किया जाता है। इससे एक से दूसरी बेब पेजों पर पहुंचना, डाउनलोड करना आसान हो जाता है। यह मेल करने के लिए भी बनाया जाता है।

What is anchor tag in html in hindi?

Anchor tag को <a> से लिखा जाता है। यह लिंक बनाने के काम आता है। यह टैग web pages को एक-दूसरे से जोड़े रखता है। यह कभी-कभी अगले वेब पेज को उसी टैब में खोल देता है,तो कभी दूसरे टैब में खोलता है। जैसी भी कोडिं ग की जाती है।

Anchor tag से दूसरे web page लिंक करने के लिए <a href="link url">link name</a> लिखा जाता है। उदाहरण के लिए...

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<meta http-equiv="X-UA-Compatible" content="IE=edge">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>list example</title>

</head>

<body>

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

</body>

</html>

और यह ऐसा दिखता है:-

इस पर क्लिक करने पर Google का वेब पेज खुल जाता है।

डाउनलोड का लिंक बनाने के लिए <a href="file url"download> Link name </a> लिखा जाता है।

फाइल url मौजूद होनी चाहिए, नहीं तो डाउनलोड complete नहीं होगा। उदाहरण के लिए-

<a href="index.html"download>Download</a>

Download पर क्लिक करने पर index.html फाइल डाउनलोड होने लगती है।

Mail लिंक बनाने पर उस मेल आईडी पर मेल भेजने की परमिशन मांगी जाती है। परमिशन मिलने पर उस मेल आईडी पर मेल स्वतः ही भेज दिया जाता है। मेल लिंक बनाने के लिए कोडः

<a href="mailto:abc@xyz.com">Mail me</a>

_blank पर target करने पर लिंक अगले टैब में खुलती है। Target define न करने पर उसी टैब में लिंक खुलती है।

<a href="url" target=_blank>Link name</a>