From the Living Standard, Links §4.6.1, Link Kinds.
One of four elements may be designated a Link.
the link element, from EG1 — Document
the a element, from EG4 — Text-Level
the area element, from EG5 — Embedded
the form element, from EG7 — Forms
Notably, base
is not a Link despite presenting
the href and
target attributes.
Links are further split into three kinds,
depending on the context, its attribute values.
Hyper-Links
Exposed to the user, for clicking, tapping, etc.
Typically
a,
area,
and not link.
Elements link
with expect.
Targets an ID in the current document
awaiting it being
connected & fully parsed
, blocking the rendering until then.
Subject, Predicate, Object
All referential relationships are representable as a triple
(Subject, Predicate, Object).
In HTML Links, Subject is always the Document.
Predicate is specified as the Link rel.
Object is specified as the Link href.
Representing the file-system as anchors,
directories point to contained files, which may be
marked href=./d_name
with rel=item,
or rel=contents.
The parent would be href='..'
with rel=up or rel=index,
from walking dirent recursively, mapping its char d_name[].
The rel Predicate
Encodes the nature of the relationship with the referent.
Relationships may be purely meta-data encodings that have no effects on
the page, nevertheless they may be parsed by automation tools.
Some rels have an active effect where the user-agent may fetch the resource,
mostly applicable to the link element.
The IANA registry of link relations is a central authority for existing values,
giving a description of the expected referent.
The href Subject
The value should be a valid URL,
which may be relative (to the directory
containing the html file, in absence of
base changes).
It may also use hash-fragments, including internally: a href='#elem'
targets the current document's id='elem'.
Unless the protocol is specified in the reference URL,
the current one is used:
Within file:///public/pages/page.html
linking href='../assets/file.html'
resolves to file:///public/assets/file.html.
The target Browsing Context
Clickable links open their referent in some
browsing context.
The target specifies
which to pick.
This is particularly relevant for framed pages
via iframe,
object etc. determining
if clicking a framed link
loads the linked resource inside the frame,
or in the parent frame.
target
Browsing Context
_self
Current one
_blank
A new, unnamed one
_parent
Parent of the current one
_top
The top-most one
URL Attributes Reference
The reference table below lists attributes for elements
that accept one or more URLs that should be valid and
trigger a resource fetching, depending on the context.
Obselete attributes that may still function
are not mentioned, as well as attributes from
obsolete elements. In addition, URLs are used
in CSS url(...),
potentially in any element (e.g. to set the
background-image).
Attribute
Description
Elements
action
endpoint target of form submission
form
cite
source document
blockquote, del, ins, q
data
resource to be used by the object
object
formaction
form action override
button, input [†]
href
linked resource.
a, area, link [‡]
manifest
document cache manifest
html
ping
endpoint list notified on link followed
a, area
poster
image shown when downloading/before played
video
src
media shown
audio, embed, iframe, img, input, script, source, track, video
srcset
media shown (contextual, e.g. viewport)
img, source
usemap
name of an image-map to use
img, input, object
† type='submit' and type='image'
‡ as well as base, different in function
Linked rel='preload'as Reference
A link
with rel='preload'
is used to pre-loaded referent resources
early, when the browser parses it instead
of later when it parses the embedded element
using the linked content.
It is combined with the attribute
as taking values
from the list below, specifying the kind
of embedding.
audio : for audio media
image : for image
and picture media with
srcset or
imageset,
svg,
and targets of external background-image