📜  HTML link标签

📅  最后修改于: 2020-11-04 00:49:34             🧑  作者: Mango

HTML标签

HTML标签用于指定当前文档和外部源之间的关系。

标记通常用于链接当前文档的外部样式表,但也可以与链接站点图标一起使用。它放在文档的头部。


以下是有关HTML的一些规范标签

Display None
Start tag/End tag Both Start and End tag
Usage textual




    Link Tag
    


    

Example of Link Tag

This is paragraph which is styled with external style sheet.

body{
    background-color: #7ac5cd;
        text-align: center;}
h2{
    color: #006400;}

p{
    color: #cd5c5c;
    font-size: 25px;
    font-style: italic;}

输出:

属性:

特定于标签的属性:

Attribute Value Description
charset char_encoding It defines the character encoding of linked source. (Not supported in HTML5)
href URL It specifies the location of the linked document.
hreflang language_code Specifies the text language of linked source.
media media_query It specifies the media, for which linked source is applied.
rel
  • alternate
  • author
  • dns-prefetch
  • help
  • icon
  • license
  • next
  • pingback
  • preconnect
  • prefetch
  • preload
  • prerender
  • prev
  • search
  • stylesheet
It describes the relationship between the current document and linked document. (required)
rev reversed
relationship
It describes the relationship between the linked document and the current document. (Not supported in HTML5)
sizes Height* weight It specifies the size of the linked source. It should be only used with rel=”icon.”
target _blank
_self
_top
_parent
frame_name
It determines where to load the linked document.
type media_type It specifies the media type of document.

全局属性:

标签支持HTML中的全局属性

事件属性:

标签支持HTML中的事件属性。

支持的浏览器

Element chrome browser Chrome ie browser IE firefox browser Firefox opera browser Opera safari browser Safari
Yes Yes Yes Yes Yes