In HTML, link types indicate the relationship between two documents, in which one links to the other using an <a> , <area> , <form> ,或 <link> 元素。

List of the defined link types and their significance in HTML
Link Type 描述 Allowed in these elements Not allowed in these elements
alternate
  • If the element is <link> rel attribute also contains the 样式表 type, the link defines an alternative style sheet ; in that case the title attribute must be present and not be the empty string.
  • type 被设为 application/rss+xml or application/atom+xml , the link defines a syndication feed . The first one defined on the page is the default.
  • Otherwise, the link defines an alternative page, of one of these types:
    • for another medium, like a handheld device (if the media attribute is set)
    • in another language (if the hreflang attribute is set),
    • in another format, such as a PDF (if the type attribute is set)
    • a combination of these
<a> , <area> , <link> <form>
archives Defines a hyperlink to a document that contains an archive link to this one. For example, a blog entry could link to a monthly index page this way.

注意: Although recognized, the singular archive is incorrect and must be avoided.
<a> , <area> , <link> <form>
作者 Defines a hyperlink to a page describing the author or providing a way to contact the author.

注意: This may be a mailto: hyperlink, but this is not recommended on public pages as robot harvesters will quickly lead to a lot of spam sent to the address. In that case, it is better to lead to a page containing a contact form.

Although recognized, the rev attribute on <a> , <area> or <link> elements with a link type of made is incorrect and should be replaced by the rel attribute with this link type.
<a> , <area> , <link> <form>
bookmark Indicates that the hyperlink is a permalink for the nearest ancestor <article> element. If none, it is a permalink for the section that the element is most closely associated to.

This allows for bookmarking a single article in a page containing multiple articles, such as on a monthly summary blog page, or a blog aggregator.
<a> , <area> <link> , <form>
canonical From Wikipedia, the free encyclopedia: Canonical_link_element
A canonical link element is an HTML element that helps webmasters prevent duplicate content issues by specifying the "canonical" or "preferred" version of a web page as part of search engine optimization.
<link> <a> , <area> , <form>
dns-prefetch Hints to the browser that a resource is needed, allowing the browser to do a DNS lookup and protocol handshaking before a user clicks the link. <link> <a> , <area> , <form>
external Indicates that the hyperlink leads to a resource outside the site of the current page; that is, following the link will make the user leave the site. <a> , <area> , <form> <link>
第一 Indicates that the hyperlink leads to the first resource of the sequence the current page is in.

注意: Other link types related to linking resources in the same sequence are last , prev , next .

Although recognized, the synonyms begin and start are incorrect and must be avoided.
<a> , <area> , <link> <form>
help
  • If the element is <a> or <area> , it indicates that the hyperlink leads to a resource giving further help about the parent of the element, and its descendants.
  • If the element is <link> it indicates that the hyperlink leads to a resource giving further help about the page as a whole.
<a> , <area> , <form> , <link> None.
icon Defines a resource for representing the page in the user interface, usually an icon (auditory or visual). In the browser, it is usually referred to as the favicon .

If there are multiple <link rel="icon"> s, the browser uses their media , type ,和 sizes attributes to select the most appropriate icon. If several icons are equally appropriate, the last one is used. If the most appropriate icon is later found to be inappropriate, for example because it uses an unsupported format, the browser proceeds to the next-most appropriate, and so on.

注意: Apple's iOS does not use this link type, nor the sizes attribute, like others mobile browsers do, to select a webpage icon for Web Clip or a start-up placeholder. Instead it uses the non-standard apple-touch-icon and apple-touch-startup-image 分别。

shortcut link type is often seen before icon , but this link type is non-conforming, ignored and web authors must not use it anymore .
<link> <a> , <area> , <form>
import HTML Imports <link> <a> , <area> , <form>
index Obsolete since HTML5 Indicates that the page is part of a hierarchical structure and that the hyperlink leads to the top level resource of that structure.

If one or several up link types are also present, the number of these up indicates the depth of the current page in the hierarchy.
<a> , <area> , <link> <form>
last Indicates that the hyperlink leads to the last resource of the sequence the current page is in.

注意: Other link types related to linking resources in the same sequence are 第一 , prev , next .

Although recognized, the synonym end is incorrect and must be avoided.
<a> , <area> , <link> <form>
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.

注意: Although recognized, the synonym copyright is incorrect and must be avoided.
<a> , <area> , <form> , <link> None.
manifest Indicates that the linked file is a Web App Manifest . <link> <a> , <area> , <form>
modulepreload Initiates early (and high-priority) loading of module scripts. <link> <a> , <area> , <form>
next Indicates that the hyperlink leads to the next resource of the sequence the current page is in.

注意: Other link types related to linking resources in the same sequence are 第一 , prev , last .
<a> , <area> , <form> , <link> None.
nofollow Indicates that the linked document is not endorsed by the author of this one, for example if it has no control over it, if it is a bad example or if there is commercial relationship between the two (sold link). This link type may be used by some search engines that use popularity ranking techniques. <a> , <area> , <form> <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 ,和 _parent are all treated like _blank in terms of deciding whether to open a new window/tab.

<a> , <area> , <form> <link>
noreferrer Prevents the browser, when navigating to another page, to send this page address, or any other value, as referrer via the Referer: HTTP header.
(In Firefox, before Firefox 37, this worked only in links found in pages. Links clicked in the UI, like "Open in a new tab" via the contextual menu, ignored this).
<a> , <area> , <form> <link>
opener Reverts implicit rel="noopener" addition on links with target="_blank" (见 related HTML spec discussion , WebKit change ,和 Firefox bug discussion ). <a> , <area> , <form> <link>
pingback Defines an external resource URI to call if one wishes to make a comment or a citation about the webpage. The protocol used to make such a call is defined in the Pingback 1.0 规范。

注意: X-Pingback: HTTP header is also present, it supersedes the <link> element with this link type.
<link> <a> , <area> , <form>
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> , <form>
prefetch Suggests that the browser fetch the linked resource in advance, as it is likely to be requested by the user. Starting with Firefox 44, the value of the crossorigin attribute is taken into consideration, making it possible to make anonymous prefetches.

注意: Link Prefetch FAQ has details on which links can be prefetched and on alternative methods.
<link> <a> , <area> , <form>
preload Tells the browser to download a resource because this resource will be needed later during the current navigation. See 采用 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> , <form>
prev Indicates that the hyperlink leads to the preceding resource of the sequence the current page is in.

注意: 还可以使用 next keyword to specify a link to the next page in the sequence.

Although recognized, the synonym 上一 is incorrect and must be avoided.
<a> , <area> , <link> , <form> None.
search Indicates that the hyperlink references a document whose interface is specially designed for searching in this document, or site, and its resources.

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> , <form> None.
shortlink shortlink 规范
From Wikipedia, the free encyclopedia: URL shortening
Some websites create short links to make sharing links via instant messaging easier.
<link> ???
sidebar Obsolete since 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>
样式表 Defines an external resource to be used as a stylesheet. If the type is not set, the browser should assume it is a text/css stylesheet until further inspection.

If used in combination with the alternate keyword, it defines an alternative style sheet ; in that case the title attribute must be present and not be the empty string.
<link> <a> , <area> , <form>
tag Indicates that the hyperlink refers to a document describing a tag that applies to this document.

注意: This link type should not be set on links to a member of a tag cloud as these do not apply to a single document but to a set of pages.
<a> , <area> <link> , <form>
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> <form>

规范

规范 状态 注释
Preload
The definition of 'preload' in that specification.
候选推荐 添加 preload .
Resource Hints
The definition of 'preconnect' in that specification.
工作草案 添加 dns-prefetch , preconnect ,和 prerender 值。
HTML 实时标准
The definition of 'link types' in that specification.
实时标准 添加 opener and made noopener the default behavior for target="_blank" links.
HTML5
The definition of 'link types' in that specification.
推荐 添加 tag , search , prefetch , noreferrer , nofollow , icon ,和 作者 .
重命名 copyright to license .
移除 start , chapter , section , subsection ,和 appendix
HTML 4.01 Specification
The definition of 'link types' in that specification.
推荐 添加 alternate , 样式表 , start , chapter , section , subsection , appendix ,和 bookmark .
重命名 上一 to prev .
移除 top ,和 search .
未知
The definition of '<link>' in that specification.
过时 添加 top , contents , index , glossary , copyright , next , 上一 , help ,和 search .
RFC 1866: HTML 2.0 过时 初始定义。

浏览器兼容性

The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
rel Chrome 完整支持 1 Edge 完整支持 12 Firefox 完整支持 1 IE 完整支持 Yes Opera 完整支持 Yes Safari 完整支持 Yes WebView Android 完整支持 Yes Chrome Android 完整支持 Yes Firefox Android 完整支持 4 Opera Android 完整支持 Yes Safari iOS 完整支持 Yes Samsung Internet Android 完整支持 Yes
Alternative stylesheets. Chrome 不支持 1 — 48 Edge ? Firefox 完整支持 3 IE 完整支持 8 Opera 完整支持 Yes Safari ? WebView Android ? Chrome Android ? Firefox Android 完整支持 4 Opera Android ? Safari iOS ? Samsung Internet Android ?
dns-prefetch 实验性 Chrome 完整支持 46 Edge 完整支持 ≤79 Firefox 完整支持 3 IE ? Opera 完整支持 33 Safari ? WebView Android 完整支持 46 Chrome Android 完整支持 Yes Firefox Android 完整支持 4 Opera Android ? Safari iOS ? Samsung Internet Android 完整支持 Yes
icon Chrome 完整支持 4 注意事项
完整支持 4 注意事项
注意事项 If both ICO and PNG are available, will use ICO over PNG if ICO has better matching sizes set. (Per caniuse.com.)
Edge 完整支持 12 注意事项
完整支持 12 注意事项
注意事项 In version 79 and later (Blink-based Edge), if both ICO and PNG are available, will use ICO over PNG if ICO has better matching sizes set. (Per caniuse.com.)
Firefox 完整支持 2 IE 完整支持 11 Opera 完整支持 9 注意事项
完整支持 9 注意事项
注意事项 In version 15 and later (Blink-based Opera), if both ICO and PNG are available, will use ICO over PNG if ICO has better matching sizes set. (Per caniuse.com.)
Safari 完整支持 3.1 注意事项
完整支持 3.1 注意事项
注意事项 If both ICO and PNG are available, will ALWAYS use ICO file, regardless of sizes set. (Per caniuse.com.)
WebView Android 完整支持 38 Chrome Android 完整支持 18 Firefox Android 完整支持 4 Opera Android 不支持 No Safari iOS 不支持 No 注意事项
不支持 No 注意事项
注意事项 Does not use favicons at all (but may have alternative for bookmarks, etc.). (Per caniuse.com.)
Samsung Internet Android 完整支持 4.0
manifest 实验性 非标 Chrome 不支持 No Edge 不支持 No Firefox ? IE ? Opera 不支持 No Safari ? WebView Android 完整支持 39 Chrome Android 完整支持 39 Firefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android 完整支持 4.0
modulepreload 实验性 Chrome 完整支持 66 Edge 完整支持 ≤79 Firefox ? IE ? Opera 完整支持 53 Safari ? WebView Android 完整支持 66 Chrome Android 完整支持 66 Firefox Android ? Opera Android 完整支持 47 Safari iOS ? Samsung Internet Android 完整支持 9.0
preconnect 实验性 Chrome 完整支持 46 Edge 完整支持 79 Firefox 完整支持 39 注意事项
完整支持 39 注意事项
注意事项 Before Firefox 41, it doesn't obey the crossorigin 属性。
IE 不支持 No Opera 完整支持 33 Safari 完整支持 11.1 WebView Android 完整支持 46 Chrome Android 完整支持 46 Firefox Android 完整支持 39 注意事项
完整支持 39 注意事项
注意事项 Before Firefox 41, it doesn't obey the crossorigin 属性。
Opera Android 完整支持 33 Safari iOS 完整支持 11.3 Samsung Internet Android 完整支持 4.0
prefetch 实验性 Chrome 完整支持 8 Edge 完整支持 12 Firefox 完整支持 2 IE 完整支持 11 Opera 完整支持 15 Safari 不支持 No WebView Android 完整支持 4.4 Chrome Android 完整支持 18 Firefox Android 完整支持 4 Opera Android 完整支持 14 Safari iOS 不支持 No Samsung Internet Android 完整支持 1.5
preload 实验性 Chrome 完整支持 50 Edge 完整支持 ≤79 Firefox 不支持 56 — 57 注意事项
不支持 56 — 57 注意事项
注意事项 Disabled due to various web compatibility issues (e.g. bug 1405761 ).
IE ? Opera 完整支持 37 Safari ? WebView Android 完整支持 50 Chrome Android 完整支持 50 Firefox Android 不支持 56 — 57 注意事项
不支持 56 — 57 注意事项
注意事项 Disabled due to various web compatibility issues (e.g. bug 1405761 ).
Opera Android ? Safari iOS ? Samsung Internet Android 完整支持 5.0
prerender 实验性 Chrome 完整支持 13 Edge 完整支持 79 Firefox 不支持 No IE 完整支持 11 Opera 完整支持 15 Safari 不支持 No WebView Android 完整支持 4.4 Chrome Android 完整支持 18 Firefox Android 不支持 No Opera Android 完整支持 14 Safari iOS 不支持 No Samsung Internet Android 完整支持 1.5

图例

完整支持

完整支持

不支持

不支持

兼容性未知 ?

兼容性未知

实验。期望将来行为有所改变。

实验。期望将来行为有所改变。

非标。预期跨浏览器支持较差。

非标。预期跨浏览器支持较差。

见实现注意事项。

见实现注意事项。

元数据

  • 最后修改:
  1. HTML
  2. 教程:
  3. HTML 基础
  4. HTML 介绍
    1. Introduction to HTML overview
    2. Getting started with HTML
    3. What's in the head? Metadata in HTML
    4. HTML text fundamentals
    5. Creating hyperlinks
    6. Advanced text formatting
    7. Document and website structure
    8. Debugging HTML
    9. Assessment: Marking up a letter
    10. Assessment: Structuring a page of content
  5. 多媒体和嵌入
    1. Multimedia and embedding overview
    2. Images in HTML
    3. Video and audio content
    4. From object to iframe — other embedding technologies
    5. Adding vector graphics to the Web
    6. Responsive images
    7. Assessment: Mozilla splash page
  6. 参考:
  7. HTML 元素
    1. <a>
    2. <abbr>
    3. <acronym>
    4. <address>
    5. <applet>
    6. <area>
    7. <article>
    8. <aside>
    9. <audio>
    10. <b>
    11. <base>
    12. <basefont>
    13. <bdi>
    14. <bdo>
    15. <bgsound>
    16. <big>
    17. <blink>
    18. <blockquote>
    19. <body>
    20. <br>
    21. <button>
    22. <canvas>
    23. <caption>
    24. <center>
    25. <cite>
    26. <code>
    27. <col>
    28. <colgroup>
    29. <command>
    30. <content>
    31. <data>
    32. <datalist>
    33. <dd>
    34. <del>
    35. <details>
    36. <dfn>
    37. <dialog>
    38. <dir>
    39. <div>
    40. <dl>
    41. <dt>
    42. <element>
    43. <em>
    44. <embed>
    45. <fieldset>
    46. <figcaption>
    47. <figure>
    48. <font>
    49. <footer>
    50. <form>
    51. <frame>
    52. <frameset>
    53. <h1>
    54. <head>
    55. <header>
    56. <hgroup>
    57. <hr>
    58. <html>
    59. <i>
    60. <iframe>
    61. <image>
    62. <img>
    63. <input>
    64. <ins>
    65. <isindex>
    66. <kbd>
    67. <keygen>
    68. <label>
    69. <legend>
    70. <li>
    71. <link>
    72. <listing>
    73. <main>
    74. <map>
    75. <mark>
    76. <marquee>
    77. <menu>
    78. <menuitem>
    79. <meta>
    80. <meter>
    81. <multicol>
    82. <nav>
    83. <nextid>
    84. <nobr>
    85. <noembed>
    86. <noframes>
    87. <noscript>
    88. <object>
    89. <ol>
    90. <optgroup>
    91. <option>
    92. <output>
    93. <p>
    94. <param>
    95. <picture>
    96. <plaintext>
    97. <pre>
    98. <progress>
    99. <q>
    100. <rb>
    101. <rp>
    102. <rt>
    103. <rtc>
    104. <ruby>
    105. <s>
    106. <samp>
    107. <script>
    108. <section>
    109. <select>
    110. <shadow>
    111. <slot>
    112. <small>
    113. <source>
    114. <spacer>
    115. <span>
    116. <strike>
    117. <strong>
    118. <style>
    119. <sub>
    120. <summary>
    121. <sup>
    122. <table>
    123. <tbody>
    124. <td>
    125. <template>
    126. <textarea>
    127. <tfoot>
    128. <th>
    129. <thead>
    130. <time>
    131. <title>
    132. <tr>
    133. <track>
    134. <tt>
    135. <u>
    136. <ul>
    137. <var>
    138. <video>
    139. <wbr>
    140. <xmp>
  8. 全局属性
    1. accesskey
    2. autocapitalize
    3. class
    4. contenteditable
    5. contextmenu
    6. data-*
    7. dir
    8. draggable
    9. dropzone
    10. hidden
    11. id
    12. inputmode
    13. is
    14. itemid
    15. itemprop
    16. itemref
    17. itemscope
    18. itemtype
    19. lang
    20. part
    21. slot
    22. spellcheck
    23. style
    24. tabindex
    25. title
    26. translate
    27. x-ms-acceleratorkey
    28. x-ms-format-detection
  9. <input> 类型
    1. <input type="button">
    2. <input type="checkbox">
    3. <input type="color">
    4. <input type="date">
    5. <input type="datetime">
    6. <input type="datetime-local">
    7. <input type="email">
    8. <input type="file">
    9. <input type="hidden">
    10. <input type="image">
    11. <input type="month">
    12. <input type="number">
    13. <input type="password">
    14. <input type="radio">
    15. <input type="range">
    16. <input type="reset">
    17. <input type="search">
    18. <input type="submit">
    19. <input type="tel">
    20. <input type="text">
    21. <input type="time">
    22. <input type="url">
    23. <input type="week">
  10. 文档编制:
  11. 有用清单
  12. All pages index
  13. Pages tagged "HTML"
  14. 贡献
    1. HTML 文档状态
    2. MDN 工程

版权所有  © 2014-2026 乐数软件    

工业和信息化部: 粤ICP备14079481号-1