Home
HTML
HTML Images
Picture element
Tryit: HTML picture source
Run ❯
Get your
own
website
Result Size:
625 x 534
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head> <body> <h2>The picture Element</h2> <picture> <source srcset="img_avatar.png"> <source srcset="img_girl.jpg"> <img src="img_beatles.gif" alt="Beatles" style="width:auto;"> </picture> <p>The picture element can be used when the image format is not supported by all devices.</p> <p>The device will use the first image format it supports, and ignore the rest of the images.</p> </body> </html>