Favorites

HTML imagesrcset Attribute

imagesrcset
HTML AttributeThis attribute is supported by all modern browsers.
Updated 22nd November 2026

The imagesrcset attribute lets a preload <link> preload the right version of a responsive image, and works like srcset on an <img>.

Looks like you're using an ad blocker, and that's fine! Ads help keep CSS Portal's generators and references free, so if the site's useful to you, visit our Support page to see other ways to help.

Description

The imagesrcset attribute of the <link> element provides a list of image candidates for preloading a responsive image, in the same format as the srcset attribute of <img>. It is used together with imagesizes.

They are used on a <link> element with rel="preload" and as="image", so that a responsive image can be preloaded: the browser uses the same rules as for an <img> with srcset and sizes to pick the candidate it will actually need, instead of preloading a single, possibly wrong, file.

Syntax

<link rel="preload" as="image" imagesrcset="URL width, URL width" imagesizes="sizes">

Values

  • candidate listA comma-separated list of image URLs, each followed by a width descriptor (400w) or a pixel density descriptor (2x).

Applies To

Example

<link rel="preload" as="image"
href="hero-800.jpg"
imagesrcset="hero-400.jpg 400w, hero-800.jpg 800w, hero-1600.jpg 1600w"
imagesizes="100vw">
Open in editor

Browser Support

The following information will show you the current browser support for the HTML imagesrcset attribute. Hover over a browser icon to see the version that first introduced support for this HTML attribute.

This attribute is supported by all modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported

Looks like you're using an ad blocker, and that's fine! Ads help keep CSS Portal's generators and references free, so if the site's useful to you, visit our Support page to see other ways to help.