New! My 44-page ebook "CSS in 44 minutes" is out! 😃

Get it now →

# a

Creates a link to a URL: a web page, a section within a page, an email address... Also called the anchor element, where the a comes from.

Example: Copy

<a href="https://htmlreference.io">HTML Reference</a>

href

Defines the target of the link.

Required.

"https://htmlreference.io"

You can pass an absolute URL.

"/element/div"

You can pass a URL relative to the root domain.

target

Defines in which tab or window the clicked link will show up.

"_blank"

Opens in a new browsing context, which is usually a new tab.

"_parent"

Opens in the parent browsing context, or _self is there is none.

"_top"

Opens in the top browsing context, or _self is there is none.

rel

Defines how the link target relates to the current web page.

"nofollow"

The target is not related. Used for external websites usually.