Module link

Module link 

Source
Expand description

Attribute names for link (<link>) elements.

§Purpose

The <link> element specifies relationships between the current document and external resources, most commonly used to link stylesheets, icons, and web app manifests.

§Common Attributes

  • href: URL of the linked resource
  • rel: Relationship type (stylesheet, icon, preload, etc.)
  • type: MIME type hint for the resource
  • media: Media query for when the resource applies
  • integrity: Subresource integrity hash for security

§Example

<link rel="stylesheet" href="styles.css">
<link rel="icon" href="favicon.ico" type="image/x-icon">
<link rel="preload" href="font.woff2" as="font" type="font/woff2" crossorigin>
<link rel="manifest" href="manifest.json">
<link rel="stylesheet" href="print.css" media="print">

§WHATWG Specification

Constants§

AS
The as attribute.
CROSSORIGIN
The crossorigin attribute.
HREF
The href attribute.
INTEGRITY
The integrity attribute.
MEDIA
The media attribute.
REFERRERPOLICY
The referrerpolicy attribute.
REL
The rel attribute.
SIZES
The sizes attribute.
TYPE
The type attribute.