Skip to content

Instantly share code, notes, and snippets.

@ike
Created December 1, 2011 04:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ike/1413487 to your computer and use it in GitHub Desktop.
Save ike/1413487 to your computer and use it in GitHub Desktop.
New <picture> tag markup.
<picture>
<!-- Source for every width below 480px -->
<source src="http://bukk.it/i-approve.png" media="max-width: 480px;">
<!-- Source for widths between 480px and 800px -->
<source src="http://bukk.it/hedgehog.jpg" media="min-width: 480px; max-width: 800px;">
<!-- Source for all widths above 800px -->
<source src="http://bukk.it/facepalm.jpg" media="min-width: 800px;">
<!-- Image placeholder. In legacy it will be populated by polyfill,
browsers that support <picture> will ignore. -->
<img src ="">
<!-- Load this image if no JS support is present -->
<noscript>
<img src="http://bukk.it/facepalm.jpg">
</noscript>
</picture>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment