53
Because of its specification in the HTML DTD, the name attribute may contain character references
[p.40] . Thus, the value Dürst is a valid name attribute value, as is Dürst . The id
attribute, on the other hand, may not contain character references.
Use
id
or
name
? Authors should consider the following issues when deciding whether to use
id
or
name
for an anchor name:
The
id
attribute can act as more than just an anchor name (e.g., style sheet selector, processing
identifier, etc.).
Some older user agents don't support anchors created with the
id
attribute.
The
name
attribute allows richer anchors names (with entities [p.40] ).
12.2.4 Unavailable and unidentifiable resources
A reference to an unavailable or unidentifiable resource is an error. Although user agents may vary in how
they handle such an error, we recommend the following behavior:
If a user agent cannot locate a linked resource, it should alert the user.
If a user agent cannot identify the type of a linked resource, it should still attempt to process it. It
should alert the user and may allow the user to intervene and identify the document type.
12.3 Document relationships: the LINK element
<!ELEMENT LINK - O EMPTY -- a media-independent link -->
<!ATTLIST LINK
%attrs; -- %coreattrs, %i18n, %events --
charset %Charset; #IMPLIED -- char encoding of linked resource --
href %URI; #IMPLIED -- URI for linked resource --
hreflang %LanguageCode; #IMPLIED -- language code --
type %ContentType; #IMPLIED -- advisory content type --
rel %LinkTypes; #IMPLIED -- forward link types --
rev %LinkTypes; #IMPLIED -- reverse link types --
media %MediaDesc; #IMPLIED -- for rendering on these media --
>
Start tag: required, End tag: forbidden
Attributes defined elsewhere
id, class (document-wide identifiers [p.65] )
lang (language information [p.71] ), dir (text direction [p.73] )
title (element title [p.57] )
style (inline style information [p.174] )
onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove,
onmouseout, onkeypress, onkeydown, onkeyup (intrinsic events [p.240] )
href, hreflang, type, rel, rev (links and anchors [p.135] )
target (target frame information [p.200] )
media (header style information [p.174] )
143
12.3 Document relationships: the LINK element