当前位置: 首页 > 网络学院 > 网页制作基础教程 > HTML > HTML <link>标签
This element defines the relationship between two linked documents.
这个元素可以用来定义两个相互连结着的文档
In HTML the <link> tag has no end tag.
在HTML中<link>标签没有关闭标签
In XHTML the <link> tag must be properly closed.
在XHTML 中的<link>标签必须合理的关闭
Note: The link element is an empty element, it contains attributes only.
注意:link元素为空元素,它只包含属性
Note: This element goes only in the head section, but it can appear any number of times.
注意:这个元素只可以放在head区域,但它可以重复出现。
How to use the <link> tag to link to an external style sheet: <head> |
DTD indicates in which DTD the attribute is allowed. S=Strict, T=Transitional, and F=Frameset.
下表中的DTD列指明了被支持的DTD属性。S=Strict(精确的),T=Transitional(传统的),F=Frameset(框架)
属性名 | 值 | 描述 | DTD |
---|---|---|---|
charset | charset | Defines the character encoding of the target URL. Default value is "ISO-8859-1" 定义目标URL的字符编码。默认值为"ISO-8859-1" | STF |
href | URL | The target URL of the resource 资源地址 | STF |
hreflang | language_code | Defines the base language of the target URL 定义目标URL的基本语言 | STF |
media | all braille projection screen speech | Specifies on what device the document will be displayed 指定文档可在什么设备上显示 | STF |
rel | alternate appendix bookmark chapter contents copyright glossary help home index next prev section start stylesheet subsection | Defines the relationship between the current document and the targeted document 定义目标文档和当前文档间的关系 | STF |
rev | alternate appendix bookmark chapter contents copyright glossary help home index next prev section start stylesheet subsection | Defines the relationship between the targeted document and the current document 定义目标文档和当前文档间的关系 | STF |
target | _blank _self _top _parent | Where to open the target URL. 以什么方式打开目标URL
| TF |
type | MIME_type like: text/css text/javascript image/gif | Specifies the MIME type of the target URL 指定目标URL的MIME类型 | STF |
id, class, title, style, dir, lang, xml:lang |
For a full description, go to Standard Attributes.
查看完整的属性
onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup |
For a full description, go to Event Attributes.
查看完整的属性
Link to an external style sheet
How to use the <link> tag to link to an external style sheet.
怎样使用<link>标签将外部样式表导入