Links

Anchor element

The <a> element (or anchor element), with its href attribute, creates a hyperlink to web pages, files, email addresses, locations in the same page, or anything else a URL can address. Content within each <a> should indicate the link's destination.

Example:

Check out Google!

<a href="https://google.com.au">Check out Google!</a>

href attribute

The href attribute is the most important part of the anchor tag. It determines where to navigate the user.

You can create an anchor without the href attribute but it will not be clickable and should be avoided.

target attribute

By default links will open in the same tab or window, which is the same as target="_self"

To open the link in a new tab or window use target="_blank"

Check out Google!

<a href="https://google.com.au" target="_blank">Check out Google!</a>

Read more at MDN Web Docs: The Anchor element