Javatpoint Logo
Javatpoint Logo

HTML <picture> tag

HTML <picture> tag is used in responsive web designing where we need to load the different images based on their viewport, height, width, orientation, and pixel density.

The <picture> tag contains one or more <source> elements and one <img> elements.

According to the viewport, the matching image will be loaded from different <source> tag, and if no source contains the matching image, then the default image present in <img> tag will be displayed on the browser.

This tag is a new tag in HTML5.


Following are some specifications about the HTML <picture> tag

Display Inline
Start tag/End tag Both Start and End tag
Usage Image


Test it Now


HTML picture tag


Tag-specific attributes:

Attribute Value Description
media media_query It defines and accept any media query which can be defined in CSS.
srcsetHTML Tags List URL It defines the URL of the image which can be used for different situations. (Required)
type video/ogg
It determines the MIME type
src URL It specifies the location of the image.

Global attribute:

HTML <picture> tag supports the global attributes in HTML.

Supporting Browsers

Elementchrome browser Chromeie browser IEfirefox browser Firefoxopera browser Operasafari browser Safari
Next TopicHTML pre Tag

Youtube For Videos Join Our Youtube Channel: Join Now


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA