Anchors
What Are Anchors in HTML?
The a
(aka anchor) HTML element represents a hyperlink to a web resource (a page, a file, an email, etc.).
The actual hyperlink is placed in the href
(which stands for hypertext reference
) attribute of the anchor element. The hyperlink label is placed between the anchor tags.
<a href="https://soundof.it">
The best source of IT Tutorials - soundof.IT
</a>
The href
can point not only to pages or files but also to emails (mailto:
), phone numbers (tel:
) and page sections (#
).
Anchor Specific Attributes
The anchor element can be configured with several specific attributes. The most notable of them are:
-
download
- indicates to the user agent to download the linked resource instead of displaying it, -
hreflang
- indicates the linked resource language, -
target
- indicates where to display the linked resource (use_blank
to open in a new tab), -
rel
- indicates the relationship or relationships with the linked resource (e.g.nofollow
,author
,license
,alternate
,next
,prev
,first
,last
,external
).