HTML Attributes
HTML imagesrcset attribute
Provides responsive image candidates for a link preload. Match the final image's srcset and sizes so the preload selects the appropriate resource. Applicable elements include: <link>. Check each element’s value rules. Example uses illustrative URLs or local assets; provide the corresponding files or application endpoints when running it.
Formal Syntax & Structure
html syntaxhtml
imagesrcset="small.jpg 400w, large.jpg 800w"Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| imagesrcset | image candidate list | Provides responsive image candidates for a link preload. Match the final image's srcset and sizes so the preload selects the appropriate resource. |
Working Example
Example Snippethtml
<link rel="preload" as="image" imagesrcset="small.jpg 400w, large.jpg 800w" imagesizes="100vw">