HTML Tag
The tag defines the relationship between the current document and an external resource.
The tag is most often used to link to external style sheets or to add a favicon to your website.
The element is an empty element, it contains attributes only.
Browser Support
Attributes
Attribute | Value | Description |
---|---|---|
crossorigin | anonymous use-credentials | Specifies how the element handles cross-origin requests |
href | URL | Specifies the location of the linked document |
hreflang | language_code | Specifies the language of the text in the linked document |
media | media_query | Specifies on what device the linked document will be displayed |
referrerpolicy | no-referrer no-referrer-when-downgrade origin origin-when-cross-origin unsafe-url | Specifies which referrer to use when fetching the resource |
rel | alternate author dns-prefetch help icon license next pingback preconnect prefetch preload prerender prev search stylesheet | Required. Specifies the relationship between the current document and the linked document |
sizes | HeightxWidth any | Specifies the size of the linked resource. Only for rel=»icon» |
title | Defines a preferred or an alternate stylesheet | |
type | media_type | Specifies the media type of the linked document |
Global Attributes
Event Attributes
Related Pages
Default CSS Settings
Most browsers will display the element with the following default values:
COLOR PICKER
Report Error
If you want to report an error, or if you want to make a suggestion, do not hesitate to send us an e-mail:
Thank You For Helping Us!
Your message has been sent to W3Schools.
Top Tutorials
Top References
Top Examples
Get Certified
W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookie and privacy policy.