The general situation here is: there are many instances where making element content link to other content via HTML requires clumsy structures, and others where it is basically impossible. One example of clumsiness is linking images, which requires wrapping an a
element around an img
element just to make the latter "clickable". One example of impossibility is linking an entire table row.
Some possible solutions:
hreflang
, media
, ping
, rel
, target
, and type
href
, hreflang
, media
, ping
, rel
, target
, and type
to a number of elements in HTML5link
, which has the same basic effectlinklang
to add the semantics of hreflang
(the other attributes can still be added as is)a
so that it can wrap around any arbitrary collection of elementshlink
that can wrap around any arbitrary collection of elementsBeyond the general case, it is very helpful to look at individual elements that would benefit from being linkable and demonstrate the reasons why this capability would be helpful.
Just to make clear that there are strong reasons to keep the traditional linking element as a member of the firmament.
href
hreflang
media
ping
rel
target
type
Not every instance of a hyperlink will be centered on some non-a
element. Having a generic hyperlink element is still just as valuable as the day the web was invented. Furthermore, there would be something of a backwards-compatibility issue if the element were dropped.
The elements for which I felt able to justify calling for addition of linking ability. The general guiding principle is that any case where it would be reasonable to wrap an a
element around an element, or have an a
element be the sole child of an element, indicates strong potential for a valid use case.
In my examples I use the href
attribute because it makes the most sense to me, but in all cases I considered foremost whether it made sense to have an element become linkable as orthogonal to the exact method of achieving that linkage. Collectively, these form an argument for allowing a more robust and flexible linking mechanism, regardless of its specific form. Note too that I am assuming that adding href
also means adding hreflang
, media
, ping
, rel
, target
, and type
, for all the reasons those attributes are useful for the a
element.
title
There are two primary situations where an abbreviation should be linked elsewhere: when linking to an organization whose name is an abbreviation; and when linking to a dfn
-enclosed definition of the abbreviation elsewhere in the document.
Note: if acronym
is ever restored to HTML5, the same rationale and use cases given here would apply for that element. I'm not holding my breath.
<p>The <dfn id="whatwg"><abbr title="Web Hypertext Application Technology Working Group" href="http://whatwg.org/">WHATWG</abbr></dfn> is a loose unofficial collaboration of Web browser manufacturers and interested parties who wish to develop new technologies designed to allow authors to write and deploy Applications over the World Wide Web.</p> <p>The <abbr title="Web Hypertext Application Technology Working Group" href="#whatwg">WHATWG</abbr> community does not have much representation from Asia.</p>
Linked author contact information is generally more useful than unlinked author contact information.
<address href="mailto:emeyer@example.com">Eric A. Meyer</address> <address href="http://meyerweb.com/eric/">Eric A. Meyer</address> <address href="http://mag.example.com/article/132/authors/">Ian Hickson, David Baron, and the Dalai Lama</address>
In cases where an aside is a pullquote, it makes sense to link to the source of the quote that's been pulled. It may also be the case that an aside references an external resource and that linking the entire aside to that resource is a better user experience than linking a subset of the aside's text with an a
element.
<aside href="http://guide.example.org/">Want to learn more? Our Giving Guide has the answers you seek!</aside> <p>He later joined a large company, continuing on the same work. <q>I love my job. <span id="aside-03">People ask me what I do for fun when I'm not at work. But I'm paid to do my hobby, so I never know what to answer.</span> Some people wonder what they would do if they didn't have to work... but I know what I would do, because I was unemployed for a year, and I filled that time doing exactly what I do now.</q></p> <aside href="#aside-03"> <q> People ask me what I do for fun when I'm not at work. But I'm paid to do my hobby, so I never know what to answer. </q> </aside>
cite
To create a link to the source of the quoted material. This alone could be handled by the cite
attribute, but the problem is that all of the linking semantics offered by the a
element's attributes are lost here. Thus, for example, it is impossible to indicate the media type of a podcast, or the base language of a quoted article.
It is possible that both cite
and href
could be present with differing values. This would permit a citation of the whole work while linking to a section of the work, for example. In cases where a blockquote
has differing values for cite
and href
, the href
value should be used when the user activates the element.
<blockquote href="http://podcast.example.net/42" media="audio/x-mp3"> <p>So I told him I wasn't interested unless he threw in a Coney Island hot dog.</p> </blockquote> <blockquote cite="http://www.whatwg.org/specs/web-apps/current-work/" href="http://www.whatwg.org/specs/web-apps/current-work/#the-blockquote"> <p>The best way to represent a conversation is not with the cite and blockquote elements, but with the dialog element.</p> </blockquote>
To create a link to the cited resource. With the various attributes, it becomes possible to indicate the media type of cited a podcast, or the base language of a cited article.
<p><cite href="http://www.whatwg.org/specs/web-apps/current-work/">HTML5</cite> is a work in progress.</p> <p>I found <cite href="http://podcast.example.net/42" media="audio/x-mp3">Episode 42 of the "Frank 'n' Beans Hour"</cite> to be less amusing than previous entries.</p>
A fragment of code may need to be linked to the program from which it has been excerpted, or to documentation on that bit of code.
<p>In WordPress, information about the blog installation can be retrieved using the <code href="http://codex.wordpress.org/Template_Tags/bloginfo">bloginfo()</code> function.</p>
cite
datetime
Providing a link to more detailed reasoning about the deletion. This alone could be handled by the cite
attribute, but the problem is that all of the linking semantics offered by the a
element's attributes are lost.
It is possible that both cite
and href
could be present with differing values. This would permit a citation of the whole work while linking to a section of the work, for example. In cases where a del
has differing values for cite
and href
, the href
value should be used when the user activates the element.
<del cite="http://blog.example.com/2008/06/04/sorry-hixie-i-was-on-drugs" href="http://blog.example.com/2008/06/04/sorry-hixie-i-was-on-drugs#p5" datetime="2008-06-04T23:45-04:00">I really hate cats.</del>
title
While there can be provision of an in-document definition, it is often useful to link to a more detailed or extended definition.
<p>The <dfn href="http://www.gateworld.net/omnipedia/technology/links/g.d.o..shtml"> <abbr title="Garage Door Opener">GDO</abbr></dfn> is a device that allows off-world teams to open the iris.</p>
In cases where a fragment of a longer dialog is presented, it is useful to be able to link back to the original source dialog, so as to provide the context for the provided fragment.
Note: it may be argued that this can be made unnecessary by wrapping the dialog
element in a linked blockquote
element.
<dialog href="http://meyerweb.com/eric/thoughts/2006/11/19/thats-pretty-old/"> <dt>Carolyn</dt> <dd>Daddy, what old is Bear?</dd> <dt>Eric</dt> <dd>Do you mean how old is Bear?</dd> <dt>Carolyn</dt> <dd>How old is Bear, yes.</dd> <dt>Eric</dt> <dd>I don't know, sweetie. How old do you think he is?</dd> </dialog>
There are times when a flow element is needed to contain a few bits of information that are all related, and could all benefit from being linked to an in-depth resource. Examples include error messages, portal boxes, and artistic gallery pages.
<div id="error_note" href="/error-list.html"> <h3>Errors</h3> <p>No errors.</p> </div> <div class="photo" href="19823-detail.html"> <img src="pix/19283.jpg" alt="" /> 19283. Lady in waiting. </div>
A figure may properly link to more information or an alternate view of the content(s) enclosed in the figure. Examples include high-resolution versions of displayed images, pages which provide more detailed information about the figure, and so on.
<figure href="bubbles-work-hires.jpg"> <img src="bubbles-work.jpeg" alt="Bubbles, sitting in his office chair, works on his latest project intently."> <legend>Bubbles at work</legend> </figure> <figure href="castle-history.html"> <img src="castle1423.jpeg" title="Etching. Anonymous, ca. 1423." alt="The castle has one tower, and a tall wall around it."> <img src="castle1858.jpeg" title="Oil-based paint on canvas. Maria Towle, 1858." alt="The castle now has two towers and two walls."> <img src="castle1999.jpeg" title="Film photograph. Peter Jankle, 1999." alt="The castle lies in ruins, the original tower all that remains in one piece."> <legend>The castle through the ages: 1423, 1858, and 1999 respectively.</legend> </figure>
While footers may contain multiple pieces of information, in many cases they will be used to provide "back to top" or "back to table of contents" functionality. It is also possible that a footer containing a quick notice of ownership would need to link to a more detailed page containing terms of use, privacy policies, and more.
<footer href="../">Back to index...</footer> <h1>Lorem ipsum</h1> <p>A dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> <footer href="../">Back to index...</footer>
Headings are sometimes linked to other resources. One example would be linking a site-identifying h1
to the home page of the site.
<h1 href="/index.html">ConHugeCo Inc.</h1>
Headings are sometimes linked to other resources. One example would be linking the chapter titles in a table of contents to the actual chapter documents.
<h1>Table of Contents</h1> <h2 href="ch1.html">Chapter 1. Introduction</h2> <h2 href="ch2.html">Chapter 2. Tea For Two</h2> <h2 href="ch3.html">Chapter 3. Thrice the Price</h2> <h2 href="ch4.html">Chapter 4. The Larch</h2>
Headings are sometimes linked to other resources. One example would be linking the section and subsection headings of a particularly long document back to the top of the page.
<h3 href="#top">Enjoying the sun</h3>
Headings are sometimes linked to other resources.
See the examples for h1
, h2
, and h3
.
Headings are sometimes linked to other resources.
See the examples for h1
, h2
, and h3
.
Headings are sometimes linked to other resources.
See the examples for h1
, h2
, and h3
.
alt
height
ismap
src
usemap
width
It is incredibly common to have an image link to some other resource—a higher-resolution version, a resource of another medium (such as an image of a speaker linking to an audio file), or another web page.
<img src="picture22.gif" href="picture22-hires.gif" alt="A picture of my face"> <img src="audio.gif" alt="Audio file (822KB)" href="ringtone.mp3"> <img href="page27.html" src="next.gif" alt="Next page">
cite
datetime
Providing a link to more detailed reasoning about the insertion. This alone could be handled by the cite
attribute, but the problem is that all of the linking semantics offered by the a
element's attributes are lost.
It is possible that both cite
and href
could be present with differing values. This would permit a citation of the whole work while linking to a section of the work, for example. In cases where a ins
has differing values for cite
and href
, the href
value should be used when the user activates the element.
<ins cite="http://blog.example.com/2008/06/04/sorry-hixie-i-was-on-drugs" href="http://blog.example.com/2008/06/04/sorry-hixie-i-was-on-drugs#p8" datetime="2008-06-04T23:45-04:00">I just lurrrve cats, especially little kitties.</ins>
There are circumstances in which a bit of keyboard input needs to be linked to explanatory information. This would be especially useful in "help" systems and tutorials for newcomers to a program (or computing in general).
If you want to access the console press <kbd href="where-is-the-tilde-key.htm">Tilde</kbd>
There are circumstances in which the legend of a figure
, fieldset
, or other containing object should link to more information or a related resource.
<fieldset> <legend href="/help/personalinfo.html">Personal information</legend> ... </fieldset> <figure> <object type="application/x-java-applet"> <param name="code" value="MyJavaClass"> <p>You do not have Java available, or it is disabled.</p> </object> <legend href="/proj/java/clock.html">My Java Clock</legend> </figure>
value
In many cases, most obviously the use of a list to contain a set of navigation links, list items are entirely filled by hyperlinks and no other content. Although the a
elements may sometimes be useful for styling purposes, they are superfluous structural elements and could in some cases be replaced by linked list items.
<nav> <h1>Navigation</h1> <ul> <li href="articles.html">Index of all articles<li> <li href="today.html">Things sheeple need to wake up for today<li> <li href="successes.html">Sheeple we have managed to wake<li> </ul> </nav>
Content which has been highlighted using mark
may be served by creating a link to some resource which explains in more detail the reason for the highlighting. It also provides a method by which highlighting marks can refer to other parts of the same document.
<p><mark href="#notes">An obstruction in a gate will prevent it from accepting a wormhole connection.</mark></p>
high
low
max
min
optimum
value
Meters will often benefit from being linked to resources which explain how the metered levels are determined, or to give more detailed information about the specific metering level being displayed.
<p><meter value="0.25" href="/ranking.html#low">Low activity,</meter> Usenet, 66 subscribers</p> <meter href="/how-we-measure.html" min=0 max=20 value=12 title="centimeters">12cm</meter>
max
value
In a fashion similar to meter
, progress
indicators will in some cases need to be linked to more details about the thing whose progress is being tracked. This would be especially helpful in cases where there are multiple progress indicators on a single page, such as a download tracker.
<progress href="details?thing=7">21%</progress>
cite
To create a link to the source of the quoted material. This alone could be handled by the cite
attribute, but the problem is that all of the linking semantics offered by the a
element's attributes are lost here. Thus, for example, it is impossible to indicate the media type of a podcast, or the base language of a quoted article.
It is possible that both cite
and href
could be present with differing values. This would permit a citation of the whole work while linking to a section of the work, for example. In cases where a q
has differing values for cite
and href
, the href
value should be used when the user activates the element.
<p>As Tim Berners-Lee said, <q href="http://example.com/quotes/tbl33.html"> "That idea of URL was the basic clue to the universality of the Web. That was the only thing I insisted upon."</q></p> <p>His best argument: <q href="http://lists.example.org/Archives/2008/Mar/71193#p22" cite="http://lists.example.org/Archives/2008/Mar/71193">I disagree!</q></p>
Samples of output are often not enough to provide a full working knowledge of their causes and resolution. Linking to more information is often desirable in these circumstances.
The program responded with <samp href="manual-error500.html">Error 500: Program had an error!</samp>, so I reverted the config file.
Subscript elements often represent terms or concepts which may be unfamiliar to the reader; for example, in formulas. They can also be used to denote numeric systems which would benefit from being linked to more detailed explanations.
V = V<sub href="transverse.html">T</sub> - V<sub href="radial.html">r</sub> 100<sub href="binary.html">bin</sub> = 4<sub href="decimal.html">dec</sub></pre>
Superscript elements are used to create footnote references, and those references are usually linked to the actual footnotes (with corresponding superscripted numbers in the footnotes that link back to the referencing text). Rather than having a sup
wrapping an a
element, it would make more sense to link the superscript itself.
<p>It has been shown that the decline in pirates is directly correlated to the rise in global temperatures.<sup href="#footnote-003">[3]</sup></p>
colspan
rowspan
In tables of data, each cell is often a small fragment of content summarizes more in-depth data. For example, a cell might contain a total dollar amount for a certain product or period of time (or both), or test results, or any number of other things. The ability to click on that cell and get a detailed breakdown of the figures that went into the presented content is highly valuable.
<td href="sales?product=a44">$27,924</td> <td href="benchmark?ua=ff&t=7">244ms</td>
colspan
rowspan
scope
Table headers can be cryptic in the interests of having small amounts of content. Being able to link from those cells directly to a legend (or key) explaining what they mean improves the usefulness of the table.
<th href="legend.html#PHA">PHA</th> <th href="legend.html#O2V%">O2V %</th>
datetime
There are two use cases here. The first is where time-based information may need to link to more detailed information; for example, the times in a public transportation schedule linking to more information about that route, station, or bit of the schedule. The other, which is already widespread, is the use of posting times as "permalinks" for both blog posts and comments on them.
<time datetime="2008-06-05T16:50:37-00:00" href="http://meyerweb.com/eric/thoughts/2008/06/05/strengthening-links/">Thu 5 Jun 2008 1250</time>
In tables of data, each row is often a grouping of information that summarizes more in-depth data. For example, a row of numbers showing income and expense totals for one month of the year could link to a detailed breakdown of that month's activity. The ability to click on the row to get to that information is highly valuable.
<tr href="show_flow.php?month=200805"> ... </tr> <tr href="sales?state=OH&product=722"> ... </tr>
A variable may be defined (in the sense of its role in a program being explained) away from mention of the variable, so linking to the definition assists in recall and learning. Less commonly, there may be a need to link to related material which explains the use of variables in general.
<p>Here we pass the variable <var href="#var-loop">loop</var> to the function.</p> <p>If there are <var href="what-is-n.html">n</var> pipes leading to the ice cream factory then I expect at <em>least</em> <var>n</var> flavours of ice cream to be available for purchase!</p>
It is a widespread convention that embedded video leads back to a main page or other resource describing more about the video (see, for example, any embedded YouTube or Vimeo video).
<video src="bigdog.mov" href="http://bostondynamics.com/content/sec.php?section=BigDog" autoplay controls>
These are the elements that seemed to be good candidates on the first pass, but upon further reflection failed to present obvious use cases. I'm open to suggestions.
I'm not sure there's any reasonable case for linking an entire article.
???
I had thought that a caption could link to more information about the table in question, but that seemed better handled by linking the actual table itself.
???
Sort of by definition (ah ha ha), the contents of this element should provide whatever information is needed—in other words, there shouldn't be a need to link to more detailed information.
???
open
I'm not even 100% sure I get what this element is meant to do, so it was hard to find a use case for linking it.
???
The only thing this would seem to need to link to is the associated dd
, which is right there in the markup (as in adjacent) so attribute-based linking doesn't seem to make much sense. On the other hand, should this be added as a machinie-parseable way of associating a definition with the term? Or do we rely on the structural adjacency for that?
???
There was a fairly straightforward use case for footer
, but this didn't have the same ease of casing.
???
A whole paragraph as a link... hmmm. This didn't seem too likely a scenario.
???
Like p
, it was hard to think of a reason to need to link an entire pre
.
???
It really seemed like if you needed a generic inline element to create a hyperlink, you'd use a
, not span
.
???
Do the rationales presented for tr
, th
, and td
make sense when applied to the whole table? Are there other rationales for full-table linking?
???
Though it seemed obvious that one would extrapolate from cell linking to row linking to table-sectional linking, no specific use cases came to mind when actually faced with tbody
. If it's possible to have multiple tbody
elements in the same table, then use cases are much easier to imagine, but the specification doesn't make clear whether or not this is the case. If multiples are not allowed, then is there any reason to make this element linkable?
(The same questions and thinking hold for tfoot
and thead
.)
???
See tbody
.
???
See tbody
.
???
These are the elements that did not seem to have use cases when I first went through the list. They are included here to round out the list of HTML5 elements, and also as a resource for reconsidering whether any of them would benefit from being linkable.
audio
b
bdo
body
br
canvas
col
colgroup
command
datagrid
datatemplate
dl
em
embed
event-source
hr
html
i
iframe
mark
map
menu
meta
nav
nest
noscript
object
ol
param
rule
script
section
small
source
strong
style
title
ul
Those elements that already provide some form of linking via the href
attribute, and so don't need extra linkability. Two—a
and area
—also have the attributes hreflang
, media
, ping
, rel
, target
, and type
.
a
area
base
link