Sree Sankar

Anchor Tag or <a> or hyperlink

log

The <a> tag defines a hyperlink, which is used to link from one page to another page (this will be the same website or different website). The most important attribute of the <a> element is the href attribute, which indicates the link's destination.

By default, links will appear as follows in all browsers:

An unvisited link is underlined and blue
A visited link is underlined and purple
An active link is underlined and red

Some Examples

We can go to wikipedia, like external website

        
            <a href="https://www.wikipedia.com">
            Visit Wikipedia.com!</a>
        
    

or We can go to our previous page

        
            <a href="./page7.html">Goto Page 7</a>
        
    

Results

Visit Wikipedia.com!
Goto Page 7

"a" tags are inline level elements; it only take the content width to diplay

The main attributes are "href" and "target"; We should have to explain about target

target are denoting where to open the webpage in browser

_blank - It opens the link in a new window.
_parent - It opens the linked document in the parent frameset.
_self - It is the default value. It opens the linked document in the same frame.
_top - It opens the linked document in the full body of the window.