-->

anchor and Link Tags

 

Anchor Tag:

HTML में anchor tag  का उपयोग किसी यूजर को किसी एक document से किसी another document पर refer करने के लिए किया जाता है l HTML anchor  को डिफाइन करने के लिए हम <a> tag का उपयोग करते है l इस टैग को एंकर टैग कहा जाता है l <a> Opening tag बताता है कि Link कहां से आरंभ हुआ है और </a> Closing tag बताता है कि Link कहां समाप्त होता है। इन दोनों के बीच में जो भी content लिखा जाता है वो सब कुछ एक Link के रूप में काम करता है l

Note - 

·         एक unvisited लिंक को underline और नीले रंग में प्रदर्शित होता है।

·         एक visited लिंक underline और बैंगनी रंग का होता है।

·         एक active लिंक underlined और लाल रंग का होता है।

 

ATTRIBUTES

VALUES

DESCRIPTION

href

 

target

_blank   - Linked webpage ये नए window पर open होता है |

_parent - Linked webpage ये parent frame पर open होता है |

_self -  Linked webpage ये same frame पर open होता है |

_top  - Linked webpage ये पूरे window पर open होता है |

frame name - दिए हुए frame name पर linked webpage open होता है |

title

text

 

hreflang

 

 

download

download

 

name

text

 

 

Syntax:

<a href = "Document URL" ... attributes-list>Link Text</a>

Example

<!DOCTYPE html>

<html>  

   <head>

      <title>Hyperlink Example</title>

   </head>           

   <body>

      <p>Click following link</p>

      <a href = "https://www.stechinstitute.com" target = "_self">Tutorials Point</a>

   </body>

</html>

HTML Email Tag

 

<a> tag as an email tag, you will use mailto: email address along with href attribute.

EXAMPLE:

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

<a href = "mailto:abc@example.com?subject = Feedback&body = Message">

Send Feedback </a>

HTML Phone Number Tag

<a> tag as an email tag, you will use tel: email address along with href attribute.

EXAMPLE:

<a href="tel:123-456-7890">123-456-7890</a>

Link Color:

हम <body> टैग के link, alink और vlink विशेषताओं का उपयोग करके अपने link, active link और vitited किए गए लिंक के रंग सेट कर सकते हैं।

 

EXAMPLE –

 

<!DOCTYPE html>

<html>

   <head>

      <title>Hyperlink Example</title>

      <base href = "https://www.stechinstitute.com/">

   </head>

   <body alink = "#54A250" link = "#040404" vlink = "#F40633">

      <p>Click following link</p>

      <a href = "/html/index.htm" target = "_blank" >HTML Tutorial</a>

   </body>

</html>

 

Link Tag –

HTML <link> टैग का उपयोग किसी बाहरी दस्तावेज़ के लिंक को Define करने के लिए किया जाता है। इसे Document के <head> section में रखा गया है।

EXAMPLE-

<head>

<link rel="stylesheet" href="/css/main.css" type="text/css">

</head>