HTML LINKS
HTML Links क्या है?
"दो या दो से अधिक Webpages को मिलाकर website बनती है और एक webpage से दूसरे webpage में जाने के लिए links की आवश्कता पडती हैं। इसलिए हम कह सकते हैं कि एक page से दूसरे page में जाने की Process को Links कहा जाता हैं।"
HTML Links को Hyperlinks भी कहा जाता हैं।
जब भी आप अपने mouse के pointer को link के उपर लेकर जाते हो, तो वह change होकर हाथ जैसे निशान में convert हो जाता है। यही links की वास्तविक पहचान हैं।
यह जरूरी नहीं है कि link सर्फ text ही हो सकता है। यह image या कोई ओर HTML Element भी हो सकता हैं।
Internet की दुनिया में HTML LINKS बहुत महत्वपूर्ण हैं और यह links प्रतेक Website में होते हैं।
Syntax of HTML Links:
<a href="url">Link Text</a>
- Hyperlink को <a> tag के द्वारा define किया जाता हैं। यह tag <a> से शरू होकर </a> पर end होते हैं।इस <a> tag को anchor tag भी कहा जाता हैं।
- href attribute के द्वारा address की destination को डाला जता हैं। (eg. www.techbyantimshinde.blogspot.com)
- Link Text syntax का visible part होता है। जो HTML Page में देखाई देता हैं।
उदाहरण:
Output:
HTML Links
Visit Techbyantimshinde.blogspot.comडिफ़ॉल्ट रूप से, लिंक सभी ब्राउज़रों में निम्नानुसार दिखाई देंगे:
An unvisited link is underlined and blue
A visited link is underlined and purple
An active link is underlined and red
HTML Links - target Attribute क्या है?
Now, आपने देखा होगा कि link पर जब आप click करते हो तो वह उसी page में खुल जता हैं।
परन्तु, मान लीजिए आप चाहतें हैं कि link page किसी दूसरे browser tab में खुले, तो इसके लिए आप target attribute का use कर सकते हैं।
target Attribute की निम्नलिखित Values हैं जो इस प्रकार हैं:
- _blank – इसके जरिये आप link या document को नई tab में खोल सकते हैं।
- _parent – इसके जरिये आप link या document को parent frame में खोल सकते हैं।
- _top – इसके जरिये webpage full window में खुलता है।
- _self – इसके जरिये आप link या document को उसी tab में खोल सकते हैं और यह by default होता है।
उदाहरण:
Output:
The target Attribute
Visit Techbyantimshinde.blogspot.comIf target="_blank", the link will open in a new browser window or tab.
Local Links:
उपर दिए गये address एक full web address हैं।
लेकिन मानलो की आप चाहते हो अपने किसी webpage को link करना हैं तो कैसे करोगे, तो इसका उपयोग करने के लिए हम use करते हैं local links।
Local link बनाने में https और www का प्रयोग नहीं होता हैं।
उदाहरण:
HTML Link - एक Link के रूप में एक Image का उपयोग करें:
एक Link के रूप में एक image का उपयोग करने के लिए, simply <img> Tag को <a> Tag के अंदर रखेंगे :
उदाहरण:
Output:
HTML Links - एक Link के रूप में Button:
एक Link के रूप में HTML Button का उपयोग करने के लिए, आपको कुछ JavaScript Code जोड़ना होगा।
JavaScript आपको Specify करने की अनुमति देता हैं कि कुछ Events पर क्या होता हैं, जैसे कि एक Button पर Click :
उदाहरण:
Output:
Button as a Links
Click the button to go to the HTML tutorial TechByAntimShinde.
HTML Links - एक Email पते से Link करें:
HTML से आप Email Link भी बना सकते हैं।
Email Link के द्वारा आप Users को सीधे Email Programs तक ले जा सकते हैं।
Mailto का उपयोग करें, उन्हें एक नया Email भेजने के लिए।
एक Email Link इस प्रकार बनाई जाती हैं :
उदाहरण:
Output:
HTML Links - Link Title :
title Attribute के जरिये आप Elements की Extra Information दे सकते हो।
यह Information तभी show होगी जब Mouse Pointer को आप Link के उपर लेकर जाओगे।
उदाहरण:
Output:
Link Titles
HTML Color Links:
यदि आप Links का color change करना चाहते हो तो style attribute के द्वारा वो भी कर सकते हो।
परन्तु links का color by default underline के साथ blue color दिखता हैं और देखने में कुछ ज्यादा attractive भी नहीं दिखता हैं।
उदाहरण:
Output:
HTML Links - Bookmarks:
यदि वेब पेज बहुत बड़ा है तो Bookmark का उपयोग कर सकते हैं।
Bookmark बनाने के लिए, पहले Bookmark बनाएं, फिर उसमें एक लिंक जोड़ें।
जब लिंक पर क्लिक किया जाता है, तो पृष्ठ Bookmark के साथ नीचे या ऊपर स्क्रॉल करेगा।
उदाहरण:
पहले Bookmark बनाने के लिए id विशेषता का उपयोग करें, फिर उसी पेज के भीतर से Bookmark ("Jump Into Lesson 6") के लिए एक लिंक जोड़ें।
Output:
Lesson 1
This Lesson Explains.
Lesson 2
This Lesson Explains.
Lesson 3
This Lesson Explains.
Lesson 4
This Lesson Explains.
Lesson 5
This Lesson Explains.
Lesson 6
This Lesson Explains.
Lesson 7
This Lesson Explains.
Lesson 8
This Lesson Explains.
Lesson 9
This Lesson Explains.
Lesson 10
This Lesson Explains.
Lesson 11
This Lesson Explains.
Lesson 12
This Lesson Explains.
Lesson 13
This Lesson Explains.
Lesson 14
This Lesson Explains.
Lesson 15
This Lesson Explains.
Lesson 16
This Lesson Explains.
Lesson 17
This Lesson Explains.
Lesson 18
This Lesson Explains.
Lesson 19
This Lesson Explains.
Lesson 20
This Lesson Explains.
0 Comments