public
Created

Picture element type attribute example

  • Download Gist
gistfile1.html
HTML
1 2 3 4 5 6 7 8 9
<picture alt="">
<!-- If browser supports WebP, use image below: -->
<source src="fullsize.webp" type="image/webp">
<!-- Else, use image from which ever source tag currently matches -->
<source src="mobile.jpg">
<source src="medium.jpg" media="min-width: 600px">
<source src="fullsize.jpg" media="min-width: 900px">
<img src="mobile.jpg">
</picture>

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.