这篇翻译不完整。请帮忙从英语翻译这篇文章

在超文本标记语言中,在两种文档之间可以指定<a>, <area><link> 元素使一个页面链接到另一个页面。

下面是链接类型及其在 HTML 中的意义
链接类型 描述 支持的元素 不被支持的元素
alternate
  • 如果是<link>元素,并且rel属性包括stylesheet, 则这个link定义为alternate样式表;那样的话 title 属性不能为空.
  • 如果type设置为application/rss+xml或者application/atom+xml, 则link被定义为syndication feed. 页面中第一个被定义的为默认的。
  • 其它情况link定义为alternate页面:
    • 另一种介质,例如手持设备(如果设置了 media 属性),
    • 另一种语言 (如果设置了hreflang 属性),
    • 另一种格式, 例如PDF (如果设置了type 属性),
    • 或者是以上这些的集合.

(译注:link的alternate定义了一个可替换的样式表,它和第一个link元素同时使用,第一个定义了首选样式,而alternate则让用户可选择替换的样式。但这个替换操作需要 浏览器支持,但很多浏览器比如IE都是不支持的。

所以使用到替换样式的网页,一般都用一些样式表切换的JS,让用户可以自由切换界面样式。这个应该大家都见过,一些网站会给网页定义多种配色。 稍高阶的一些,还可以利用 JS弄成随时间变化样式的,比如白天的时候显示成明色,晚上的时候显示成暗色。

<a>, <area>, <link>

None.

archives

定义文档的超链接,该文档包含此文件的存档链接. 例如. 一个博客入口可以链接到每月索引页面。

Note: 虽然能够识别奇异文档,并不正确,必须避免出现.
<a>, <area>, <link> None.
author 定义一个超链接到一个描述作者信息的页面或者提供一个方法联系作者。

Note: 这个方法可能是mailto:邮箱链接, 但不推荐这样,这样可能导致机器人发送大量的垃圾邮件到这个邮箱. 这种情况下,最好带一个包含联系方法的页面.。

<a>, <area> or<link> 标签的rev属性上,虽然能够识别 made,但并不正确,应该用rel 属性替换.
<a>, <area>, <link> None.
bookmark 表明这个链接是一个固定链接,对于最近的<article> 祖先标签. 如果没有,则表最近的section标签
bookmark允许标识一个包括多个文档的页面,例如每月汇总的博客页面,或者博客集合。
<a>, <area> <link>
canonical

来自维基百科: Canonical_link_element
规范链接元素是一个HTML元素,它通过指定web页面的“规范”或“首选”版本作为搜索引擎优化的一部分,帮助网站管理员防止重复的内容问题。

<link>    <a>, <area>, <form>
dns-prefetch 提示浏览器该资源需要在用户点击链接之前进行DNS查询和协议握手. <link> <a>, <area>
external 表明这个链接,是一个相对于当前网站的外部资源。点击这个链接会离开当前网站。 <a>, <area> <link>
first 
表明这个链接是当前页面资源序列中的第一个

Note: 其它选项last, prev, next.

虽然能够识别beginstart但并不正确,应该避免使用。
<a>, <area>, <link> None.
help
  • 如果是一个<a> 或者 <area>标签, help表明这个链接,链接到一个关于父亲标签和它的后代的进一步帮助资源;
  • 如果是一个<link>标签,help表明这个链接,链接到一个关于整个页面的进一步帮助资源.
<a>, <area>, <link> None.
icon

定义一个在用户界面上代表这个页面的资源,通常是一个图标(包括声音和图像)

media, type and sizes 属性允许浏览器选择其上下文中最合适的图标.如果多种资源符合条件,浏览器会选择最后一个。

在树型序列中,由于这些属性只是提示, 并且这这些资源在进一步检查时可能是不适合的,浏览器可能选择另一个适合的.

Note: 苹果iOS不支持此链接类型, 也不支持 sizes属性, 就像其他移动端浏览器一样,为了Web Clip或者启动点位符选择一个页面图标。分别可使用不是标准方法的apple-touch-iconapple-touch-startup-image 替代.

在之前,经常可以看到shortcut,但他不是标准的,应该不再使用

<link> <a>, <area>
import      HTML Imports

index 已废弃 HTML5

表明这个页面是一个等级体系的一部分,这个超链接指向该体系的最顶层资源。

如果存在一个或几个 up链接,那么up链接的数目就是当前页面在这个等级体系里的深度。

<a>, <area>, <link> None.
last

表明该超链接指向当前页面所在序列中的最后资源。

注意:该序列中其他相关链接资源的link的type值是first, prev, next。

尽管同义词end可以识别,但它还是错误的,必须避免使用。

<a>, <area>, <link> None.
license Indicates that the hyperlink leads to a document describing the licensing information. If not inside the <head> element, the standard doesn't distinguish between a hyperlink applying to a specific part of the document or to the document as a whole. Only the data on the page can indicate this.

Note: Although recognized, the synonym copyright is incorrect and must be avoided.
<a>, <area>, <link> None.
manifest 表示链接到的文件是 Web App Manifest. <link> <a>, <area>
modulepreload

更早和更高优先级的加载模块脚本

<link>    <a>, <area>,
<form>
next

表明该超链接指向的是当前页面所在序列中的下一个资源。

注意:该序列中其他相关链接资源的link的type值是first, prev, last。

<a>, <area>, <link> None.
nofollow 表示本文档的作者不想宣传链接的文档,例如,它是不受控的,它是一个坏的例子或如果它们有商业关系(销售环节)。nofollow主要是被一些使用人气排名技术的搜索引擎所使用。 <a>, <area> <link>

noopener

Instructs the browser to open the link without granting the new browsing context access to the document that opened it — by not setting the Window.opener property on the opened window (it returns null).

This is especially useful when opening untrusted links, in order to ensure they cannot tamper with the originating document via the Window.opener property (see About rel=noopener for more details), while still providing the Referer HTTP header (unless noreferrer is used as well).

Note that when noopener is used, nonempty target names other than _top_self, and _parent are all treated like _blank in terms of deciding whether to open a new window/tab.

<a>, <area> <link>
noreferrer

阻止浏览器跳到另一个页面时,通过HTTP头,发送当前页面的名字或其他值,以及把当前页设为另一个页面的引用(另一个页面的referrer值 )。
(In Firefox this work only in links found in pages. Links clicked in the UI, like via the contextual menu, doesn't abide for this value)

<a>, <area> <link>
opener Reverts implicit rel="noopener" addition on links with target="_blank" (See related HTML spec discussionWebKit change, and Firefox bug discussion). <a>, <area>,
<form>
<link>
pingback
 
Defines an external resource URI to call if one make a comment or a citation about the webpage. The protocol used to make such a call is defined in the Pingback 1.0 specification.

Note: if the X-Pingback: HTTP header is also present, this header has precedence over the <link> element with this link type
<link> <a>, <area>

preconnect

Provides a hint to the browser suggesting that it open a connection to the linked web site in advance, without disclosing any private information or downloading any content, so that when the link is followed the linked content can be fetched more quickly. <link> <a>, <area>
prefetch 提示浏览器提前加载链接的资源,因为它可能会被用户请求。

Note: the Link Prefetch FAQ has details on which links can be prefetched and on alternative method
<a> 未实现,
<area> 未实现,
<link>
None.
preload

告诉浏览器下载资源,因为在当前导航期间稍后将需要该资源。有关详细信息,请参见 Preloading content with rel="preload"

<link>    <a>, <area>,
<form>
prerender Suggests that the browser fetch the linked resource in advance, and that it also render the prefetched content offscreen so it can be quickly presented to the user once needed. <link> <a>, <area>
prev Indicates that the hyperlink leads to the precedent resource of the sequence the current page is in.

Note: other link types related to linking resources in the same sequence are first, last, next.

Although recognized, the synomyn previous is incorrect and must be avoided.
<a>, <area>, <link> None.
search Indicates that the hyperlink reference a document whose interface is specially designing for searching in this document, or site, and its resources.

If the type attribute is set to application/opensearchdescription+xml the resource is an OpenSearch plugin that can be easily added to the interface of some browsers like Firefox or Internet Explorer.
<a>, <area>, <link> None.
shortlink

shortlink 规范
来自维基百科: URL shortening
一些网站创建短链接,使通过即时消息共享链接更容易。

<link> None.
sidebar  已废弃 Gecko 63 Indicates that the hyperlink leads to a resource that would be better suited for a secondary browsing context, like a sidebar. Browsers, that don't have such a context will ignore this keyword.

While once part of the HTML specification, this has been removed from the spec and is only implemented by versions of Firefox prior to Firefox 63.
<a>, <area>, <link> <form>
stylesheet

定义要用作样式表的外部资源。如果没有设置 type,在进一步检查之前,浏览器应该假定它是 text/css 样式表。

如果与 alternate 关键字结合使用,则定义一个 可选样式表 ;在这种情况下,title 属性必须出现,而不能是空字符串。

<link> <a>, <area>
tag Indicates that the hyperlink reference a document describing a tag that applies to this document.

Note: this link type should not be set on links member of a tag cloud as these one does not apply to a single document but to a set of pages.
<a>, <area> <link>.
up
 
Indicates that the page is part of a hierarchical structure and that the hyperlink leads to the higher level resource of that structure.

The number of up link types indicates the depth difference between the current page and the linked resource.
<a>, <area>, <link> None.

规范

Specification Status Comment
Preload
preload
Candidate Recommendation Added preload.
Resource Hints
preconnect
Working Draft Added dns-prefetchpreconnect, and prerender values.
HTML Living Standard
<link>
Living Standard No change since last snapshot (HTML Living Standard)
HTML5
<link>
Recommendation Added tagstylesheetsearchprevprefetchnoreferrernofollownextlicenseiconhelpbookmarkauthor, and alternate.
HTML 4.01 Specification
<link>
Recommendation

浏览器兼容性

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
relChrome Full support 1Edge Full support YesFirefox Full support 1IE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesFirefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
Alternative stylesheets.Chrome ? Edge ? Firefox Full support 3IE ? Opera Full support YesSafari ? WebView Android ? Chrome Android ? Firefox Android Full support 4Opera Android ? Safari iOS ? Samsung Internet Android ?
dns-prefetch
Experimental
Chrome Full support 46Edge ? Firefox Full support 3IE ? Opera Full support 33Safari ? WebView Android Full support 46Chrome Android Full support YesFirefox Android Full support 4Opera Android ? Safari iOS ? Samsung Internet Android Full support Yes
manifest
ExperimentalNon-standard
Chrome No support NoEdge ? Firefox ? IE ? Opera No support NoSafari ? WebView Android Full support 39Chrome Android Full support 39Firefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android Full support 4.0
modulepreload
Experimental
Chrome Full support 66Edge ? Firefox ? IE ? Opera Full support 53Safari ? WebView Android Full support 66Chrome Android Full support 66Firefox Android ? Opera Android Full support 47Safari iOS ? Samsung Internet Android Full support Yes
noopener
Non-standard
Chrome Full support 49Edge No support NoFirefox Full support 52
Notes
Full support 52
Notes
Notes Prior to Firefox 63, rel="noopener" created windows with all features disabled by default. Starting with Firefox 63, these windows have the same features enabled by default as any other window.
IE No support NoOpera Full support 36Safari Full support 10.1WebView Android Full support 49Chrome Android Full support 49Firefox Android Full support 52
Notes
Full support 52
Notes
Notes Prior to Firefox 63, rel="noopener" created windows with all features disabled by default. Starting with Firefox 63, these windows have the same features enabled by default as any other window.
Opera Android Full support 36Safari iOS Full support 10.3Samsung Internet Android Full support 5.0
preconnect
Experimental
Chrome Full support 46Edge No support NoFirefox Full support 39
Notes
Full support 39
Notes
Notes Before Firefox 41, it doesn't obey the crossorigin attribute.
IE No support NoOpera Full support 33Safari No support NoWebView Android Full support 46Chrome Android Full support 42Firefox Android Full support 39
Notes
Full support 39
Notes
Notes Before Firefox 41, it doesn't obey the crossorigin attribute.
Opera Android ? Safari iOS No support NoSamsung Internet Android Full support 4.0
prefetch
Experimental
Chrome ? Edge ? Firefox ? IE ? Opera ? Safari ? WebView Android ? Chrome Android ? Firefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android ?
preload
Experimental
Chrome Full support 50Edge ? Firefox No support 56 — 57
Notes
No support 56 — 57
Notes
Notes Disabled due to various web compatibility issues (e.g. bug 1405761).
IE ? Opera Full support 37Safari ? WebView Android Full support 50Chrome Android Full support 50Firefox Android No support 56 — 57
Notes
No support 56 — 57
Notes
Notes Disabled due to various web compatibility issues (e.g. bug 1405761).
Opera Android ? Safari iOS ? Samsung Internet Android Full support 5.0
prerender
Experimental
Chrome ? Edge ? Firefox ? IE ? Opera ? Safari ? WebView Android ? Chrome Android ? Firefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android ?

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.
Non-standard. Expect poor cross-browser support.
Non-standard. Expect poor cross-browser support.
See implementation notes.
See implementation notes.

文档标签和贡献者

最后编辑者: gafish,