HTML Links
HTML links are hyperlinks. You can click on a link and jump to another document.
HTML Links - Syntax
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
HTML Links - The target Attribute
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
HTML Links - Use an Image as a Link
To use an image as a link, just put the `<img>` tag inside the `<a>` tag:
Image Link Example
Result