HTML link - how to use <link> tag

The HTML <link> tag is usually used to link to an external stylesheet. It can be used to define relationship between external and the current document.

Attributes

The link tag supports the global and event attributes.

crossorigin
Defines crossorigin requests are handled.Possible value are:
  • anonymous
  • use-credentials
href
Defines the URL of the linked document
hreflang
Defined the language of the linked document
media
Defines the device where the linked document will be displayed
rel
Defines the relationship of the external and current document. This attribute is required. Possible value are:
  • alternate
  • author
  • dns-prefetch
  • help
  • icon
  • license
  • next
  • pingback
  • preconnect
  • prefetch
  • preload
  • prerender
  • prev
  • search
  • stylesheet
sizes
Defines of the height and width of the linked icon
type
Defines the media type of the linked document

Examples:

<head> <link rel="stylesheet" href="file.css"> </head>