Skip to content

Instantly share code, notes, and snippets.

@uploadcare-user
Last active November 2, 2016 16:19
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 uploadcare-user/da539e80f3fd23bfdd5d8e5ca1f69b7f to your computer and use it in GitHub Desktop.
Save uploadcare-user/da539e80f3fd23bfdd5d8e5ca1f69b7f to your computer and use it in GitHub Desktop.
codeblock #3 responsive images
<picture>
<source
srcset="myimage@1000.jpg 1000w, myimage@2000.jpg 2000w"
sizes="(min-width: 1000px) 60vw, 100vw"
media="(orientation: landscape)">
<source
srcset="myimage@450.jpg 1x, myimage@900.jpg 2x"
sizes="(min-width: 450px) 450px, 100vw"
media="(orientation: landscape)">
<source
srcset="myimage@320-400.jpg 1x, myimage@640-800.jpg 2x"
media="(orientation: portrait)">
<img src="fallback.jpg">
</picture>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment