Skip to content

Instantly share code, notes, and snippets.

@basecss
Created March 7, 2014 04:47
Show Gist options
  • Save basecss/9405404 to your computer and use it in GitHub Desktop.
Save basecss/9405404 to your computer and use it in GitHub Desktop.
<style>
@media (min-device-width:600px) {
img[data-src-600px] {
content: attr(data-src-600px, url);
}
}
@media (min-device-width:800px) {
img[data-src-800px] {
content: attr(data-src-800px, url);
}
}
</style>
<!-- usage -->
<img src="image.jpg" data-src-600px="image-600px.jpg" data-src-800px="image-800px.jpg" alt="">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment