HTML Anchor Tag

HTML Anchor tag used to create link one page to another page by its href attribute

Anchor tag attributes are href , target

href attribute specify the link of another page

Example

<body>

<p>Click link go to the home page of fast2learning </p>

<a href="https://www.fast2learning.com">fast2learning</a>

<body>

Example

Use anchor  tag inside heading tag

<body>

<p>Click heading go to the home page of fast2learning</p>

<h1><a href="https://www.fast2learning.com">fast2learning</a></h1>

</body>

Note: You can use anchor tag inside another tag

Target Attribute

Target attribute specify the where link open in window tab like blank , self , parent , top

target="_blank"

Target black open new tab in window

Example

<body>

<p>Click link go to the home page of fast2learning in new window tab</p>

<a href="https://www.fast2learning.com" target="_blank">fast2learning</a>

</body>

Test code

Example

target="_self"

Target self specify the link open it current tab

Example

<body>

<p>Click link  and open home page of fast2learning in current tab</p>

<a href="https://www.fast2learning.com" target="_self">fast2learning</a>

</body>

target="_parent"

Target parent attribute value specify the link open in parent tab

It mean if link inside the iframe  open in parent tab