skip to content

Icons and Manifest Links

The link tags that give a page its tab icon, home-screen icon, and installable identity. Small surface, but a common real-world task where the legacy tag soup versus the modern minimal set trips people up.

part ofHTMLoverview, primer and where to startread it →
on this pageshow

questions

5

A page's `<head>` declares several `<link rel="icon">` candidates with different `sizes` and `type` values. How does the browser decide which one to use, and where does an SVG favicon fit into that set?

level: middleimportance: nice to knowfreq 30%

basics

~20 s

The browser treats the icon links as a candidate list and picks the one whose declared sizes and type best fit the surface it is drawing. An SVG icon is size-agnostic, so one file covers every density, with an ICO or PNG behind it as a fallback.

open as a page

A staging site sits behind a session-cookie login. The page itself loads fine, but the request the browser makes for the URL in `<link rel="manifest">` comes back as the login redirect instead of the manifest JSON. What about that link explains it, and what is the fix?

level: seniorimportance: nice to knowfreq 12%

basics

~20 s

The manifest is fetched without credentials by default, so the session cookie is not sent and the server answers with the login flow. Adding crossorigin="use-credentials" to the manifest link makes the browser send credentials — this applies even when the manifest is same-origin.

open as a page

On Android, a site's installed home-screen icon shows up shrunken inside a white circle rather than filling the shape. Which part of a web app manifest's `icons` entries controls that, and how do you author the asset?

level: seniorimportance: nice to knowfreq 15%

basics

~20 s

The icon entry's purpose member controls it. With the default purpose of any, the platform pads the icon onto a background shape; an entry marked purpose maskable tells it to crop your full-bleed asset to the device's mask instead.

open as a page