HTML <link> rel Values Reference

All HTML link rel values with valid link types, effect and browser support.

Searchable HTML link rel attribute reference covering stylesheet, preload, modulepreload, preconnect, dns-prefetch, canonical, icon, manifest, alternate and more. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

What is the difference between preload and prefetch?

rel=preload tells the browser to fetch a resource needed for the current navigation with high priority, requiring an as attribute. rel=prefetch fetches a low-priority resource likely needed for a future navigation. Preload is for now; prefetch is for next.

The rel attribute on a <link> element declares the relationship between the current document and the linked resource. Different rel values trigger very different browser behaviour — from loading a stylesheet and warming a network connection to telling search engines which URL to consolidate. This reference covers the common values, what each actually does, and which companion attributes it needs to work correctly.

Two categories of rel value

It helps to think of link relations in two groups:

Resource hints and loading directives — these shape how and when the browser fetches assets, primarily for performance:

rel valueWhat it does
preloadFetch a resource needed for the current page with high priority. Requires as.
modulepreloadFetch, parse and compile a JS module (and its imports) ahead of time.
prefetchLow-priority fetch for a resource likely needed on the next navigation.
preconnectOpen a TCP/TLS connection to an origin before the first request.
dns-prefetchResolve a domain’s DNS early, without the full connection overhead.

Semantic and metadata relations — these tell browsers, search engines and other tools what the linked resource is:

rel valueWhat it does
stylesheetLoad the linked CSS and apply it to the page.
canonicalDeclare the preferred URL for this content (a search-engine hint).
alternateSignal an alternative version: a different language, format, or feed.
iconLink the page’s favicon or touch icon.
manifestLink the Web App Manifest for PWA installation.
authorLink to information about the page’s author.

Code examples with key attributes

<!-- Stylesheet — most common link element -->
<link rel="stylesheet" href="/main.css" />

<!-- Preload a web font — as and crossorigin are required -->
<link rel="preload" href="/fonts/body.woff2" as="font" type="font/woff2" crossorigin />

<!-- Modulepreload — fetches the module graph ahead of time -->
<link rel="modulepreload" href="/app.js" />

<!-- Preconnect to a CDN origin used on page load -->
<link rel="preconnect" href="https://cdn.example.com" />

<!-- DNS-prefetch for a non-critical third-party origin -->
<link rel="dns-prefetch" href="https://analytics.example.com" />

<!-- Canonical — point search engines to the preferred URL -->
<link rel="canonical" href="https://example.com/page" />

<!-- Alternate — RSS feed -->
<link rel="alternate" type="application/rss+xml" href="/feed.xml" title="Blog RSS" />

<!-- Alternate — localised version -->
<link rel="alternate" hreflang="fr" href="https://example.com/fr/page" />

<!-- Icon — SVG favicon -->
<link rel="icon" href="/favicon.svg" type="image/svg+xml" />

<!-- Web App Manifest -->
<link rel="manifest" href="/manifest.webmanifest" />

Common mistakes and precise rules

preload without as: If you omit the as attribute on a preload, the browser fetches at default priority and may fetch a second time when the resource is actually used — cancelling the performance benefit entirely.

Font preload missing crossorigin: Fonts are fetched with CORS. If you preload a font without crossorigin, the browser makes an anonymous request that is mismatched against the actual CORS-credentialed fetch, causing a double-fetch. Always add crossorigin to font preloads even for same-origin fonts.

preconnect overuse: Each preconnect holds a TCP connection open. Reserve it for origins the page definitively hits early (CDN, fonts, auth). For lower-certainty third parties, dns-prefetch has lower cost.

Multiple canonical tags: Only one canonical is meaningful per page. If two canonical links point to different URLs, search engines treat the signal as contradictory and may ignore both.

rel as a space-separated list: The attribute accepts multiple tokens — rel="alternate stylesheet" is valid and applies both relations simultaneously. This is uncommon but legitimate.