其他分享
首页 > 其他分享> > link tag

link tag

作者:互联网

link tag


link tag最常用来读取外部资源,如


    

link tag可用的属性有rel、media、href、type、sizes,各说明如下

一、rel

rel属性值是必须要被指定,其用来指出该外部资源与此Html document的关系,

下表列出rel可用的值之说明。

Value Description
alternate Provides a link to an alternate version of the document (i.e. print page, translated or mirror).
Example:
author Provides a link to the author of the document
dns-prefetch Specifies that the browser should preemptively perform DNS resolution for the target resource's origin
help Provides a link to a help document. Example:
icon Imports an icon to represent the document.
Example:
license Provides a link to copyright information for the document
next Provides a link to the next document in the series
pingback Provides the address of the pingback server that handles pingbacks to the current document
preconnect Specifies that the browser should preemptively connect to the target resource's origin.
prefetch Specifies that the browser should preemptively fetch and cache the target resource as it is likely to be required for a follow-up navigation
preload Specifies that the browser agent must preemptively fetch and cache the target resource for current navigation according to the destination given by the "as" attribute (and the priority associated with that destination).
prev Indicates that the document is a part of a series, and that the previous document in the series is the referenced document
search Provides a link to a resource that can be used to search through the current document and its related pages.
stylesheet Imports a style sheet

下图是有关部分rel属性值的用法,请参考

二、media

用来指定所读取外部资源是要应用在何目标,

最常使用的值为all、print、screen、speech,

更详细部分请参考HTML media Attribute

三、href

用来指定读取外部资源的网址。

四、type

用来指定读取外部资源的文档型态,如 "text/css"

请参考IANA Media Types

五、sizes

用来指定读取外部资源的icon图示大小,注意,只在 rel="icon" 时,sizes属性值才有效。

参考数据:

HTML Tag

DNS Prefetching

Media queries解说与max-width、min-width用法

meta tag

原文:大专栏  link tag



标签:resource,rel,tag,link,Provides,document
来源: https://www.cnblogs.com/petewell/p/11444938.html