HTML <link> Tag


The HTML <link> tag connects an external resource to the HTML content, such as a CSS file.

The <link> element is another frequent name for this tag.

Syntax

Example

Preview

Attributes

Attribute Value Description
crossorigin anonymous  
use-credentials
This property specifies how the element responds to cross-origin requests.
href URL The location of the referenced document is specified.
hreflang language-code The language of the text in the linked document is specified.
media media-query The device on which the linked document will be shown is specified.
referrerpolicy no-referrer  
no-referrer-when-downgrade  
origin  
origin-when-cross-origin  
unsafe-url
When fetching the resource, this specifies which referrer to utilize.
rel alternate  
author  
dns-prefetch  
help  
icon  
license  
next  
pingback  
preconnect  
prefetch  
preload  
prerender  
prev  
search  
stylesheet
Required. The relationship between the current document and the linked document is specified here.
sizes Height x Width  
any
The size of the referenced resource is specified here. Only when rel="icon" is used.
title   Defines whether a preferred or alternate stylesheet should be used.
type media-type The media type of the referenced document is specified.

Supported Browsers

Element Chrome Firefox Safari Edge / IE Opera
<link> Yes Yes Yes Yes Yes