# `<link>`

> The `<link>` HTML element specifies relationships between the current document and external resources, such as stylesheets.

## How do I use the link tag for CSS, icons and resource hints?

The element that is used to link external resources, such as stylesheets or icons, to the document. It's typically placed within the `<head>` element and is essential for including CSS, web fonts and other resources in a webpage.

- Topic: Links
- Type: tag
- Browser support: Chrome 1+, Chrome Android 18+, Edge 12+, Firefox 1+, Firefox Android 4+, Safari 4+, Safari iOS 3.2+

## Example

Wrong:

```html
<link href="styles.css">
<link rel="shortcut icon" href="favicon.ico">
```

Right:

```html
<link rel="stylesheet" href="styles.css">
<link rel="icon" href="favicon.svg" type="image/svg+xml">
```

Without `rel` the stylesheet is ignored, and `rel='icon'` is the standard keyword for favicons.

## Common mistakes

- Leaving out `rel` or misspelling it, so the stylesheet silently does not load.
- Loading many small render-blocking stylesheets that could be one file.

## Key points

- Stylesheets use `rel='stylesheet'` with an `href`; `type='text/css'` is not needed.
- Favicons use `rel='icon'` with the right `type`, and `sizes` when there are several.
- Resource hints like `preload` and `preconnect` are in `<head>`, so the browser sees them early.

## Interview questions

### Does a stylesheet link block rendering?

Yes, stylesheets in `<head>` block rendering until loaded. A `media` attribute limits that to the conditions where the styles apply.

### Can I load CSS without blocking first render?

Yes, a stylesheet whose `media` does not match, such as 'print', is still downloaded but does not block first render.

## Related cards

- [`<head>`](https://wonderium.dev/html/head.md)
- [\[rel="preload"\]](https://wonderium.dev/html/rel-preload.md)
- [\[rel="preconnect"\]](https://wonderium.dev/html/rel-preconnect.md)
- [`<style>`](https://wonderium.dev/html/style.md)
- [@import](https://wonderium.dev/css/import.md)

---

- Level: [HTML](https://wonderium.dev/html.md)
- HTML version: https://wonderium.dev/html/link
- Last updated: 2026-11-25
