This element defines the relationship between the
current page and external documents.
It links external style sheets to the current the document.
<link>
is usually placed in the
<head>
section of the page.
<link> |
Yes | Yes | Yes | Yes | Yes |
Some HTML 4.01 attributes are deprecated in HTML5. The "sizes" attribute is new in HTML5.
Attribute | Value | Description |
---|---|---|
charset | char_encoding | Not supported in HTML5. Set the character encoding of the linked document |
href | URL | Set the location of the linked document |
hreflang | language_code | Set the language used for the linked document |
media | media_query | Set media type for the linked document |
rel | alternate archives author bookmark external first help icon last license next nofollow noreferrer pingback prefetch prev search sidebar stylesheet tag up |
Required. Set the relationship between the current document and the linked document |
rev | reversed relationship | Not supported in HTML5. Set the relationship between the linked document and the current document |
sizes | HeightxWidth any |
Set the size of the linked resource. Only valid for rel="icon" |
target | _blank _self _top _parent frame_name |
Not supported in HTML5. Set where to load the linked document |
type | media_type | Set the media type of the linked document |
The <link> tag supports the Global Attributes in HTML.
The <link> tag supports the Event Attributes in HTML.
link { display: none; }
A demo showing how to use <link> tag.
<html> <head> <link rel="stylesheet" href="myStyleSheet.css" type="text/css"> </head> <body> This text will have the font specified in myStyleSheet </body> </html>