Skip to content

Instantly share code, notes, and snippets.

@Xavka
Created May 22, 2015 08:20
Show Gist options
  • Save Xavka/9fc8253c8a406fbf8b78 to your computer and use it in GitHub Desktop.
Save Xavka/9fc8253c8a406fbf8b78 to your computer and use it in GitHub Desktop.
<picture>
<!-- 16:9 crop -->
<source
media="(min-width: 40em)"
srcset=“images/wide/large.jpg 1920w,
images/wide/medium.jpg 960w,
images/wide/small.jpg 480w" />
sizes=“100vw"
<!-- square crop -->
<source
srcset="images/square/large.jpg 822w,
images/square/medium.jpg 640w,
images/square/small.jpg 320w" />
sizes=“100vw"
<img
src="images/wide/medium.jpg"
alt="Image description text." />
</picture>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment