HTML Hyperlinks

HTML Hyperlinks

ยท

1 min read

Table of contents

  • HTML Hyperlink is also known as the anchor tag. It is denoted with the <a> tag and is used to link one page to another.

  • It has an important attribute called href, which indicates the link destination.

  • By default, the link will appear in the browser as follows:

    • Unvisited links will appear in blue.

    • The visited link will appear in pink.

    • Active links will appear in red.

<h1>This is Google</h1> 
<a href="https://www.google.com/">Click me!</a>

  • This anchor tag has some useful target attributes. They are: _blank, _self, _parent, _top.

    • _blank: Open the document in a new window or tab
    <h1>This is Google</h1>
    <a href="https://www.google.com/" target="_blank">Click me!</a>
  • _self (default): Opens the document in the same window
    <h1>This is Google</h1>
    <a href="https://www.google.com/" target="_self">Click me!</a>
  • _parent: Opens the document in the parent frame
    <h1>This is Google</h1>
    <a href="https://www.google.com/" target="_parent">Click me!</a>
  • _top: Opens the document in the full body of the window
<h1>This is Google</h1>
<a href="https://www.google.com/" target="_top">Click me!</a>

Happy Learning

Thanks For Reading! :)

-SriParthu๐Ÿ’๐Ÿ’ฅ

Subscribe to our newsletter

Read articles from sriparthu directly inside your inbox. Subscribe to the newsletter, and don't miss out.