Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Responsive WordPress Retina Images
<picture>
<source
media="(min-width: 900px)"
srcset="large-image_1x.jpeg 1x, large-image_retina.jpeg 2x"
type="image/jpeg >
<source
media="(min-width: 601px)"
srcset="medium-image_1x.webp 1x, medium-image_retina.jpeg 2x"
type="image/jpeg" >
<source
media="(max-width: 600px)"
srcset="small-image_1x.webp 1x, small-image_1x.jpeg 1x"
type="image/jpeg" >
<img
src="large-image_1x.jpg"
type="image/jpeg"
alt="my image description">
</picture>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment