Home
HTML
HTML Picture Element
Example 2: HTML Picture Element
Run ❯❯
<!DOCTYPE html> <html> <head> <title>Different File Formats in Picture Element</title> </head> <body> <h1>Different File Formats in Picture Element</h1> <picture> <source srcset="chromelogo.png"> <source srcset="chromelogo.apng"> <source srcset="chromelogo.gif"> <img src="chromelogo.jpg" alt="Google Chrome Logo"> </picture> <p>The browser always selects the first recognized format and ignores the rest images in picture element.</p> <p>If the browser supports PNG files then first image chromelogo.png will be displayed. And other images will be ignored by the browser.</p> </body> </html>