HTML The srcset attribute
Example
in
<
picture
<
source
media
=
"
(min-width:650px)
"
srcset
=
"
https://static.jyshare.com/images/runoob-logo.png
"
<
source
media
=
"
(min-width:465px)
"
srcset
=
"
https://static.jyshare.com/images/code-icon-script.png
"
<
img
src
=
"
https://static.jyshare.com/images/mix/hjkg_icon.png
"
style
=
"width:auto;
"
picture
Try it »
Browser support
The numbers in the table indicate the first browser version that supports this property.
| property | |||||
|---|---|---|---|---|---|
| srcset | 38.0 | 13.0 | 38.0 | 9.1 | 25.0 |
Definition and Usage
The srcset attribute is used for image URLs displayed in different situations.
Differences between HTML 4.01 and HTML5
Syntax
Attribute values
| Value | Description |
|---|---|
| URL | Specifies the URL of the media file.
Possible values: |
HTML