<link>

The link element defines a relationship between the document and an external resource, most often a stylesheet.

Since HTML 2.0 Spec ↗

Syntax

<link rel="stylesheet" href="url">

Examples

<link rel="stylesheet" href="/styles.css">
<link rel="icon" href="/favicon.svg" type="image/svg+xml">
<link rel="preload" href="/font.woff2" as="font" crossorigin>
Output
Loads a stylesheet, sets the favicon, and preloads a web font; nothing is rendered visually by the tags themselves.

Notes

A void element placed in <head>. Common rel values: stylesheet, icon, preload, preconnect, canonical, alternate. Use preload/preconnect to improve loading performance.

Browser & runtime support

EnvironmentSince version
chrome 1.0
firefox 1.0
safari 1.0
edge 12

See also