HTML imagesrcset Attribute
The imagesrcset attribute lets a preload <link> preload the right version of a responsive image, and works like srcset on an <img>.
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
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.
Desktop





Tablets & Mobile





