HTML <img> srcset Attribute
Example
<img srcset="book.png 320w, cup.png 640w, desk.jpg 1200w" sizes="100vw" src="img-boy.jpg" alt="Boy" width="300" height="200">
Meaning
The srcset attribute specifies one or more strings separated by commas, indicating possible image sources for the user agent to use.
If no descriptor is specified, the source is assigned the default descriptor of 1x.
Standard Syntax
HTML: <img src="URL" alt="text" srcset="URL-list">,
XHTML: <img src="URL" alt="text" srcset="URL-list"/>
Advertisement
Attribute Values
| Value | Description |
|---|---|
| URL | Source url to an image |
| Optionally |
whitespace followed by one of:
|