Search...

HTML Links

HTML links are hyperlinks. You can click on a link and jump to another document.

The HTML `<a>` tag defines a hyperlink. It has the following syntax:

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

The most important attribute of the `<a>` element is the `href` attribute, which indicates the link's destination.

Link Example
Result

By default, the linked page will be displayed in the current browser window. To change this, you must specify another target for the link.

The `target` attribute specifies where to open the linked document. The `target` attribute can have one of the following values:

  • _self - Default. Opens the document in the same window/tab as it was clicked
  • _blank - Opens the document in a new window or tab
  • _parent - Opens the document in the parent frame
  • _top - Opens the document in the full body of the window
Target _blank Example
Result

To use an image as a link, just put the `<img>` tag inside the `<a>` tag:

Image Link Example
Result