HTML5 Tutorials & More

<link> Tag

The <link> tag defines the relationship between a document and an external resource.

Supported In HTML4: Yes

Supported In HTML5: Yes

HTML4 vs HTML5 Differences: Some HTML 4.01 attributes are not supported in HTML 5. The "sizes" attribute is new in HTML 5.

Attributes

Title Values Description HTML4 Support HTML5 Support
charset char_encoding Yes No
href URL The target URL of the resource No No
hreflang language_code Defines the base language of the target URL No No
media screen tty tv projection handheld print braille aural all Specifies on what device the document will be displayed No No
rel alternate archives author first help icon index last license next pingback prefetch prev search stylesheet sidebar tag up Specifies the relationship between the current document and the target URL. Use only if the href attribute is present No No
rev reversed relationship No No
sizes number any Defines sizes of the linked resource. Can be used when rel="icon". No No
target _blank _self _top _parent frame_name No No
type MIME_type like: text/css text/javascript image/gif Specifies the MIME type of the target URL No No

Standard Attributes

All standard attributes are supported.

Event Attributes

All event attributes are supported.

HTML5 Tags