The tag is new in HTML5.
property
New: new attribute in HTML5.
| property |
Value |
Description |
| mediaNew |
media_query |
Specifies the type of the media resource so the browser can decide whether to download it. |
| srcNew |
URL |
Specifies the URL of the media file. |
| type |
MIME_type |
Specifies the MIME type of the media resource. |
| sizes |
* * |
Setting different image sizes for different page layouts. |
| srcset |
URL |
This attribute is needed when applied to needed when using the tag. Specifies the image URL to use in different situations. |
More examples
Example
in
<
video
width
=
"
320
"
height
=
"
240
"
controls
<
source
src
=
"
movie.mp4
"
type
=
"
video/mp4
"
<
source
src
=
"
movie.ogg
"
type
=
"
video/ogg
"
Your browser does not support the video tag.
video
Try it »
Example
in is used in the tag to set images displayed on different screens:
<
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 »
Global Attributes
The tag supports [HTML Global Attributes](/tags/ref-standardattributes.html).
Event attribute
The tag supports [HTML Event Attributes](/tags/ref-eventattributes.html).