Last active
October 25, 2016 16:53
-
-
Save b4z81/9cbce9733f15ce1c9e2c80521b48ab9c to your computer and use it in GitHub Desktop.
responsive images
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<picture> | |
<source srcset="extralarge.jpg" media="(min-width: 1000px)"> | |
<source srcset="large.jpg" media="(min-width: 800px)"> | |
<img srcset="medium.jpg" alt="…"> | |
</picture> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<img srcset=" | |
examples/images/image-384.jpg 1x, | |
examples/images/image-768.jpg 2x | |
" alt="…"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.img { | |
background-image: url(examples/images/image-384.jpg); | |
} | |
@media | |
(-webkit-min-device-pixel-ratio: 2), | |
(min-resolution: 192dpi) { | |
.img { | |
background-image: url(examples/images/image-768.jpg); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment