HTML External Resource Link element ( <link> ) specifies relationships between the current document and an external resource. This element is most commonly used to link to stylesheets , but is also used to establish site icons (both "favicon" style icons and icons for the home screen and apps on mobile devices) among other things.

The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.

To link an external stylesheet, you'd include a <link> element inside your <head> 像这样:

<link href="main.css" rel="stylesheet">

This simple example provides the path to the stylesheet inside an href attribute, and a rel attribute with a value of 样式表 rel stands for "relationship", and is probably one of the key features of the <link> element — the value denotes how the item being linked to is related to the containing document. As you'll see from our Link 类型 reference, there are many different kinds of relationship.

There are a number of other common types you'll come across. For example, a link to the site's favicon:

<link rel="icon" href="favicon.ico">

There are a number of other icon rel values, mainly used to indicate special icon types for use on various mobile platforms, e.g.:

<link rel="apple-touch-icon-precomposed" sizes="114x114"
      href="apple-icon-114.png" type="image/png">

sizes attribute indicates the icon size, while the type contains the MIME type of the resource being linked. These provide useful hints to allow the browser to choose the most appropriate icon available.

You can also provide a media type or query inside a media attribute; this resource will then only be loaded if the media condition is true. For example:

<link href="print.css" rel="stylesheet" media="print">
<link href="mobile.css" rel="stylesheet" media="screen and (max-width: 600px)">

Some interesting new performance and security features have been added to the <link> element too. Take this example:

<link rel="preload" href="myFont.woff2" as="font"
      type="font/woff2" crossorigin="anonymous">

A rel value of preload indicates that the browser should preload this resource (see 采用 rel="preload" 预加载内容 for more details), with the as attribute indicating the specific class of content being fetched. The crossorigin attribute indicates whether the resource should be fetched with a CORS request.

Other usage notes:

  • A <link> element can occur either in the <head> or <body> element, depending on whether it has a link type 也就是 body-ok . For example, the 样式表 link type is body-ok, and therefore <link rel="stylesheet"> is permitted in the body. However, this isn't a good practice to follow; it makes more sense to separate your <link> elements from your body content, putting them in the <head> .
  • 当使用 <link> to establish a favicon for a site, and your site uses a Content Security Policy (CSP) to enhance its security, the policy applies to the favicon. If you encounter problems with the favicon not loading, verify that the Content-Security-Policy header's img-src directive is not preventing access to it.
  • The HTML and XHTML specifications define event handlers for the <link> element, but it is unclear how they would be used.
  • Under XHTML 1.0, empty elements such as <link> require a trailing slash: <link /> .
  • WebTV supports the use of the value next for rel to preload the next page in a document series.

属性

此元素包括 全局属性 .

as
This attribute is only used when rel="preload" or rel="prefetch" has been set on the <link> element. It specifies the type of content being loaded by the <link> , which is necessary for request matching, application of correct content security policy , and setting of correct Accept request header. Furthermore, rel="preload" uses this as a signal for request prioritization. The table below lists the valid values for this attribute and the elements or resources they apply to.
Applies To
audio <audio> 元素
document <iframe> and <frame> 元素
embed <embed> 元素
fetch fetch, XHR

This value also requires <link> to contain the crossorigin attribute.

font CSS @font-face
image <img> and <picture> elements with srcset or imageset attributes, SVG <image> elements, CSS *-image rules
对象 <object> 元素
script <script> elements, Worker importScripts
style <link rel=stylesheet> elements, CSS @import
track <track> 元素
视频 <video> 元素
worker Worker, SharedWorker
crossorigin
This enumerated attribute indicates whether CORS must be used when fetching the resource. CORS-enabled images can be reused in the <canvas> element without being tainted . The allowed values are:
anonymous
A cross-origin request (i.e. with an Origin HTTP header) is performed, but no credential is sent (i.e. no cookie, X.509 certificate, or HTTP Basic authentication). If the server does not give credentials to the origin site (by not setting the Access-Control-Allow-Origin HTTP header) the resource will be tainted and its usage restricted.
use-credentials
A cross-origin request (i.e. with an Origin HTTP header) is performed along with a credential sent (i.e. a cookie, certificate, and/or HTTP Basic authentication is performed). If the server does not give credentials to the origin site (through Access-Control-Allow-Credentials HTTP header), the resource will be tainted and its usage restricted.
If the attribute is not present, the resource is fetched without a CORS request (i.e. without sending the Origin HTTP header), preventing its non-tainted usage. If invalid, it is handled as if the enumerated keyword anonymous was used. See CORS 设置属性 for additional information.
被禁用

For rel="stylesheet" only, the 被禁用 Boolean attribute indicates whether or not the described stylesheet should be loaded and applied to the document. If 被禁用 is specified in the HTML when it is loaded, the stylesheet will not be loaded during page load. Instead, the stylesheet will be loaded on-demand, if and when the 被禁用 attribute is changed to false or removed.

设置 被禁用 property in the DOM causes the stylesheet to be removed from the document's document.styleSheets 列表。

href
This attribute specifies the URL of the linked resource. A URL can be absolute or relative.
hreflang
This attribute indicates the language of the linked resource. It is purely advisory. Allowed values are determined by BCP47 . Use this attribute only if the href attribute is present.
imagesizes
For rel="preload" and as="image" only, the imagesizes 属性为 a sizes attribute that indicates to preload the appropriate resource used by an img element with corresponding values for its srcset and sizes 属性。
imagesrcset
For rel="preload" and as="image" only, the imagesrcset 属性为 a sourceset attribute that indicates to preload the appropriate resource used by an img element with corresponding values for its srcset and sizes 属性。
integrity
Contains inline metadata — a base64-encoded cryptographic hash of the resource (file) you’re telling the browser to fetch. The browser can use this to verify that the fetched resource has been delivered free of unexpected manipulation. See Subresource Integrity .
media
This attribute specifies the media that the linked resource applies to. Its value must be a media type / media query . This attribute is mainly useful when linking to external stylesheets — it allows the user agent to pick the best adapted one for the device it runs on.

注意事项:

  • In HTML 4, this can only be a simple white-space-separated list of media description literals, i.e., media types and groups , where defined and allowed as values for this attribute, such as print , screen , aural , braille . HTML5 extended this to any kind of media queries , which are a superset of the allowed values of HTML 4.
  • Browsers not supporting CSS3 Media Queries won't necessarily recognize the adequate link; do not forget to set fallback links, the restricted set of media queries defined in HTML 4.
prefetch 安全上下文

Identifies a resource that might be required by the next navigation and that the user agent should retrieve it. This allows the user agent to respond faster when the resource is requested in the future.

referrerpolicy
A string indicating which referrer to use when fetching the resource:
  • no-referrer means that the Referer header will not be sent.
  • no-referrer-when-downgrade means that no Referer header will be sent when navigating to an origin without TLS (HTTPS). This is a user agent’s default behavior, if no policy is otherwise specified.
  • origin means that the referrer will be the origin of the page, which is roughly the scheme, the host, and the port.
  • origin-when-cross-origin means that navigating to other origins will be limited to the scheme, the host, and the port, while navigating on the same origin will include the referrer's path.
  • unsafe-url means that the referrer will include the origin and the path (but not the fragment, password, or username). This case is unsafe because it can leak origins and paths from TLS-protected resources to insecure origins.
rel
This attribute names a relationship of the linked document to the current document. The attribute must be a space-separated list of link type values .
sizes
This attribute defines the sizes of the icons for visual media contained in the resource. It must be present only if the rel contains a value of icon or a non-standard type such as Apple's apple-touch-icon . It may have the following values:
  • any , meaning that the icon can be scaled to any size as it is in a vector format, like image/svg+xml .
  • a white-space separated list of sizes, each in the format <width in pixels> x <height in pixels> or <width in pixels> X <height in pixels> . Each of these sizes must be contained in the resource.

注意: Most icon formats are only able to store one single icon; therefore most of the time the sizes attribute contains only one entry. MS's ICO format does, as well as Apple's ICNS. ICO is more ubiquitous, so you should use this format if cross-browser support is a concern (especially for old IE versions).

title
title attribute has special semantics on the <link> element. When used on a <link rel="stylesheet"> it defines a preferred or an alternate stylesheet . Incorrectly using it may cause the stylesheet to be ignored .
type
This attribute is used to define the type of the content linked to. The value of the attribute should be a MIME type such as text/html , text/css , and so on. The common use of this attribute is to define the type of stylesheet being referenced (such as text/css ), but given that CSS is the only stylesheet language used on the web, not only is it possible to omit the type attribute, but is actually now recommended practice. It is also used on rel="preload" link types, to make sure the browser only downloads file types that it supports.

Non-standard attributes

方法
The value of this attribute provides information about the functions that might be performed on an object. The values generally are given by the HTTP protocol when it is used, but it might (for similar reasons as for the title attribute) be useful to include advisory information in advance in the link. For example, the browser might choose a different rendering of a link as a function of the methods specified; something that is searchable might get a different icon, or an outside link might render with an indication of leaving the current site. This attribute is not well understood nor supported, even by the defining browser, Internet Explorer 4.
target

Defines the frame or window name that has the defined linking relationship or that will show the rendering of any linked resource.

Obsolete attributes

charset
This attribute defines the character encoding of the linked resource. The value is a space- and/or comma-delimited list of character sets as defined in RFC 2045 。默认值为 iso-8859-1 . Usage note: To produce the same effect as this obsolete attribute, use the Content-Type HTTP header on the linked resource.
rev
The value of this attribute shows the relationship of the current document to the linked document, as defined by the href attribute. The attribute thus defines the reverse relationship compared to the value of the rel 属性。 Link type values for the attribute are similar to the possible values for rel .

注意: This attribute is considered obsolete by the WHATWG HTML living standard (which is the specification MDN treats as canonical). However, it's worth noting that rev is not considered obsolete in the W3C specification. That said, given the uncertainty, relying on rev is unwise.

Instead, you should use the rel attribute with the opposite link type value . For example, to establish the reverse link for made , specify 作者 . Also this attribute doesn't stand for "revision" and must not be used with a version number, even though many sites misuse it in this way.

范例

Including a stylesheet

To include a stylesheet in a page, use the following syntax:

<link href="style.css" rel="stylesheet">
	

Providing alternative stylesheets

You can also specify alternative style sheets .

The user can choose which style sheet to use by choosing it from the View > Page Style menu. This provides a way for users to see multiple versions of a page.

<link href="default.css" rel="stylesheet" title="Default Style">
<link href="fancy.css" rel="alternate stylesheet" title="Fancy">
<link href="basic.css" rel="alternate stylesheet" title="Basic">
	

Providing icons for different usage contexts

You can include links to several different icons on the same page, and the browser will choose which one works best for its particular context using the rel and sizes values as hints.

<!-- third-generation iPad with high-resolution Retina display: -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="favicon144.png">
<!-- iPhone with high-resolution Retina display: -->
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="favicon114.png">
<!-- first- and second-generation iPad: -->
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="favicon72.png">
<!-- non-Retina iPhone, iPod Touch, and Android 2.1+ devices: -->
<link rel="apple-touch-icon-precomposed" href="favicon57.png">
<!-- basic favicon -->
<link rel="icon" href="favicon32.png">
	

Conditionally loading resources with media queries

You can provide a media type or query inside a media attribute; this resource will then only be loaded if the media condition is true. For example:

<link href="print.css" rel="stylesheet" media="print">
<link href="mobile.css" rel="stylesheet" media="all">
<link href="desktop.css" rel="stylesheet" media="screen and (min-width: 600px)">
<link href="highres.css" rel="stylesheet" media="screen and (min-resolution: 300dpi)">
	

Stylesheet load events

You can determine when a style sheet has been loaded by watching for a load event to fire on it; similarly, you can detect if an error has occurred while processing a style sheet by watching for an error event:

<script>
var myStylesheet = document.querySelector('#my-stylesheet');
myStylesheet.onload = function() {
  // Do something interesting; the sheet has been loaded
}
myStylesheet.onerror = function() {
  console.log("An error occurred loading the stylesheet!");
}
</script>
<link rel="stylesheet" href="mystylesheet.css" id="my-stylesheet">
	

注意: load event fires once the stylesheet and all of its imported content has been loaded and parsed, and immediately before the styles start being applied to the content.

Preload examples

You can find a number of <link rel="preload"> examples in Preloading content with rel="preload" .

Technical summary

内容类别 Metadata content. If itemprop is present: 流内容 and 措词内容 .
准许内容 None, it is an empty element .
Tag omission As it is a void element, the start tag must be present and the end tag must not be present
Permitted parents Any element that accepts metadata elements. If itemprop is present: any element that accepts 措词内容 .
Implicit ARIA role link with href 属性
Permitted ARIA roles No role permitted
DOM 接口 HTMLLinkElement

规范

规范 状态 注释
HTML 实时标准
The definition of '<link>' in that specification.
实时标准 添加 imagesizes and imagesrcset 属性。
HTML5
The definition of '<link>' in that specification.
推荐 添加 crossorigin and sizes attributes; extended values of media to any media queries; added numerous new values for rel .
HTML 4.01 Specification
The definition of '<link>' in that specification.
推荐

浏览器兼容性

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
link 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
charset 弃用 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
crossorigin Chrome 完整支持 25 Edge 完整支持 79 Firefox 完整支持 18 IE 不支持 No Opera 完整支持 15 Safari ? WebView Android 完整支持 37 Chrome Android 完整支持 Yes Firefox Android 完整支持 18 Opera Android ? Safari iOS ? Samsung Internet Android 完整支持 Yes
被禁用 弃用 非标 Chrome 完整支持 Yes 注意事项
完整支持 Yes 注意事项
注意事项 In Chrome and other Blink-based browsers, adding the 被禁用 attribute using JavaScript does not remove the stylesheet from document.styleSheets .
Edge 完整支持 12 Firefox 完整支持 68 IE 完整支持 Yes Opera 完整支持 Yes 注意事项
完整支持 Yes 注意事项
注意事项 In Chrome and other Blink-based browsers, adding the 被禁用 attribute using JavaScript does not remove the stylesheet from document.styleSheets .
Safari 不支持 No WebView Android 完整支持 Yes 注意事项
完整支持 Yes 注意事项
注意事项 In Chrome and other Blink-based browsers, adding the 被禁用 attribute using JavaScript does not remove the stylesheet from document.styleSheets .
Chrome Android 完整支持 Yes 注意事项
完整支持 Yes 注意事项
注意事项 In Chrome and other Blink-based browsers, adding the 被禁用 attribute using JavaScript does not remove the stylesheet from document.styleSheets .
Firefox Android 完整支持 68 Opera Android 完整支持 Yes 注意事项
完整支持 Yes 注意事项
注意事项 In Chrome and other Blink-based browsers, adding the 被禁用 attribute using JavaScript does not remove the stylesheet from document.styleSheets .
Safari iOS 不支持 No Samsung Internet Android 完整支持 Yes 注意事项
完整支持 Yes 注意事项
注意事项 In Chrome and other Blink-based browsers, adding the 被禁用 attribute using JavaScript does not remove the stylesheet from document.styleSheets .
href 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
hreflang 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
integrity 实验性 Chrome 完整支持 45 Edge 完整支持 79 Firefox ? IE 不支持 No Opera 完整支持 32 Safari 不支持 No WebView Android 完整支持 45 Chrome Android 完整支持 45 Firefox Android ? Opera Android ? Safari iOS 不支持 No Samsung Internet Android 完整支持 5.0
media 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
方法 弃用 非标 Chrome 不支持 No Edge 不支持 12 — 79 Firefox 不支持 No IE 完整支持 4 Opera 不支持 No Safari 不支持 No WebView Android 不支持 No Chrome Android 不支持 No Firefox Android 不支持 No Opera Android 不支持 No Safari iOS 不支持 No Samsung Internet Android 不支持 No
prefetch 实验性 Chrome 完整支持 56 Edge 完整支持 ≤79 Firefox ? IE 不支持 No Opera 完整支持 43 Safari ? WebView Android 完整支持 56 Chrome Android 完整支持 56 Firefox Android ? Opera Android 完整支持 43 Safari iOS ? Samsung Internet Android 完整支持 6.0
prefetch : Secure context required 实验性 Chrome 完整支持 64 Edge 完整支持 ≤79 Firefox ? IE 不支持 No Opera 完整支持 51 Safari ? WebView Android 完整支持 64 Chrome Android 完整支持 64 Firefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android 完整支持 9.0
referrerpolicy Chrome 完整支持 51 Edge 完整支持 79 Firefox 完整支持 50 IE 不支持 No Opera 完整支持 38 Safari 完整支持 11.1 WebView Android 完整支持 51 Chrome Android 完整支持 51 Firefox Android 完整支持 50 Opera Android 完整支持 41 Safari iOS 不支持 No Samsung Internet Android 完整支持 7.2
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
rel : 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 ?
rel.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
rel.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
rel.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
rel.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
rel.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
rel.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
rel.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
rel.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
rev 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
sizes 实验性 Chrome 不支持 No Edge 不支持 No Firefox 不支持 No 注意事项
不支持 No 注意事项
注意事项 bug 441770 .
IE 不支持 No Opera 不支持 No Safari 不支持 No WebView Android 不支持 No Chrome Android 不支持 No Firefox Android 不支持 No 注意事项
不支持 No 注意事项
注意事项 bug 441770 .
Opera Android 不支持 No Safari iOS 不支持 No Samsung Internet Android 不支持 No
target 弃用 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
title 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
type 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

图例

完整支持

完整支持

不支持

不支持

兼容性未知 ?

兼容性未知

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

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

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

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

弃用。不要用于新网站。

弃用。不要用于新网站。

见实现注意事项。

见实现注意事项。

另请参阅

元数据

  • 最后修改:
  1. <base>
  2. <head>
  3. <link>
  4. <meta>
  5. <style>
  6. <title>
  7. HTML 元素
    1. A
      1. <a>
      2. <abbr>
      3. <acronym>
      4. <address>
      5. <applet>
      6. <area>
      7. <article>
      8. <aside>
      9. <audio>
    2. B
      1. <b>
      2. <base>
      3. <basefont>
      4. <bdi>
      5. <bdo>
      6. <bgsound>
      7. <big>
      8. <blink>
      9. <blockquote>
      10. <body>
      11. <br>
      12. <button>
    3. C
      1. <canvas>
      2. <caption>
      3. <center>
      4. <cite>
      5. <code>
      6. <col>
      7. <colgroup>
      8. <content>
    4. D
      1. <data>
      2. <datalist>
      3. <dd>
      4. <del>
      5. <details>
      6. <dfn>
      7. <dialog>
      8. <dir>
      9. <div>
      10. <dl>
      11. <dt>
    5. E
      1. <em>
      2. <embed>
    6. F
      1. <fieldset>
      2. <figcaption>
      3. <figure>
      4. <font>
      5. <footer>
      6. <form>
      7. <frame>
      8. <frameset>
    7. G H
      1. <h1>
      2. <h2>
      3. <h3>
      4. <h4>
      5. <h5>
      6. <h6>
      7. <head>
      8. <header>
      9. <hgroup>
      10. <hr>
      11. <html>
    8. I
      1. <i>
      2. <iframe>
      3. <img>
      4. <input>
      5. <ins>
      6. <isindex>
    9. J K
      1. <kbd>
      2. <keygen>
    10. L
      1. <label>
      2. <legend>
      3. <li>
      4. <link>
      5. <listing>
    11. M
      1. <main>
      2. <map>
      3. <mark>
      4. <marquee>
      5. <menu>
      6. <menuitem>
      7. <meta>
      8. <meter>
    12. N
      1. <nav>
      2. <nobr>
      3. <noframes>
      4. <noscript>
    13. O
      1. <object>
      2. <ol>
      3. <optgroup>
      4. <option>
      5. <output>
    14. P
      1. <p>
      2. <param>
      3. <picture>
      4. <plaintext>
      5. <pre>
      6. <progress>
    15. Q
      1. <q>
    16. R
      1. <rp>
      2. <rt>
      3. <rtc>
      4. <ruby>
    17. S
      1. <s>
      2. <samp>
      3. <script>
      4. <section>
      5. <select>
      6. <shadow>
      7. <slot>
      8. <small>
      9. <source>
      10. <spacer>
      11. <span>
      12. <strike>
      13. <strong>
      14. <style>
      15. <sub>
      16. <summary>
      17. <sup>
    18. T
      1. <table>
      2. <tbody>
      3. <td>
      4. <template>
      5. <textarea>
      6. <tfoot>
      7. <th>
      8. <thead>
      9. <time>
      10. <title>
      11. <tr>
      12. <track>
      13. <tt>
    19. U
      1. <u>
      2. <ul>
    20. V
      1. <var>
      2. <video>
    21. W
      1. <wbr>
    22. X Y Z
      1. <xmp>

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

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