Related Articles

Related Articles

HTML | <a> Tag
  • Last Updated : 13 Oct, 2020

the <a> holds for anchor tag .The <a> tag in HTML is used to create a hyperlink on the webpage. This hyperlink is used to link the webpage to other webpages. It’s either used to provide an absolute reference or a relative reference as its “href” value
Syntax: 
 

<a href = "link"> Link Name </a>

Attribute values : The anchor tag contains many attributes which are listed below: 
 

  • charset: This attribute is used to specifies the character-set. It is not supported by HTML 5.
  • download: It is used to specify the target link to download when user click.
  • hreflang: It is used to specify the language of linked document.
  • media: It is used to specify the linked media.
  • coords: It is used to specify the coordinate of links. It is not supported by HTML 5.
  • name: It is used to specify the anchor name. It is not supported by HTML 5 you can use the global id attribute instead.
  • rel: It is used to specify the relation between current document and linked document.
  • shape: It is used to specify the shape of link. It is not supported by HTML 5.
  • type: It is used to specify the type of links.
  • target: It specify the target link.
  • rev: It is used to specify the relation between linked document and current document. It is not supported by HTML 5.

Example 1: 
 

html

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
    <head>
        <title>anchor tag</title>
    </head>
     
    <body>
        <p>Welcome to
            <a href = "https://www.geeksforgeeks.org/">
                GeeksforGeeks
            </a>
        </p>
    </body>
</html>                   

chevron_right


Output: 
 

Welcome to GeeksforGeeks

Example 2: 
 



html

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
    <head>
        <title>anchor tag</title>
    </head>
     
    <body>
         
        <p>Click on the image to open web page.</p>
         
        <!-- anchor tag starts here -->
        <a href="https://www.geeksforgeeks.org/">
        <img src =
        width = "300" height="250">
        </a>
        <!-- anchor tag ends here -->
         
    </body>
</html>                               

chevron_right


Output: 
 

Most browsers display the <a> tag element with the following default setting. 
 

html

filter_none

edit
close

play_arrow

link
brightness_4
code

<style>
    a:link,a:visited {
    color: (internal value);
    text-decoration: underline;
    cursor: auto;
}
 
    a:link:active,a:visited:active {
    color: (internal value);
}
 
</style>

chevron_right


Supported Browsers: The browser supported by <a> tag are listed below: 
 

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Opera
  • Safari

 

full-stack-img




My Personal Notes arrow_drop_up
Recommended Articles
Page :