HTML Tutorial – Hyperlinks

HTML links are the most common element of web page. It allows user to navigate from page to page and website to website.

HTML Example Explain

The HTML <a> tag defines a hyperlink. Syntax for hyperlink:

<a href="url">link text</a>

HTML Hyperlinks Example

<a href="https://whatabouthtml.com/">Visit WhatAboutHTML</a>
Try it yourself »

HTML Hyperlink Syntax Explained

The href attribute specifies the destination address. (https://whatabouthtml.com/)

The link text is the visible part. (Visit WhatAboutHTML)

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

HTML Links – The target Attribute

BY default the link will open in the same browsing window or tab, but you can control where to open the linked document with the target attribute.

The target attribute can have one of the following values:

  • _blank – Opens the linked document in a new window or tab
  • _self – Opens the linked document in the same window/tab as it was clicked (this is default)
  • _parent – Opens the linked document in the parent frame
  • _top – Opens the linked document in the full body of the window

HTML Hyperlinks target=”_blank” Example

<a href="https://whatabouthtml.com/" target="_blank">Visit WhatAboutHTML in new browser window or a new tab</a>
Try it yourself »