Notes
HTML links are hyperlinks.
You can click on a link and jump to another document.
Note: A link does not have to be text. A link can be an image or any other HTML element!
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.
The link text is the part that will be visible to the reader.
<a href="https://www.facebook.com/">Visit facebook!</a>
Visit facebook!
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
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