Created
April 26, 2017 09:57
-
-
Save basilalex/b80b474b522fc46660f538886190d760 to your computer and use it in GitHub Desktop.
Responsive images with high dpi and screen size.
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 | |
media="(min-width: 1024px)" | |
srcset="opera-fullshot-1x.jpg 1x, | |
opera-fullshot-2x.jpg 2x, | |
opera-fullshot-3x.jpg 3x"> | |
<img | |
src="opera-closeup-1x.jpg" alt="The Oslo Opera House" | |
srcset="opera-closeup-2x.jpg 2x, | |
opera-closeup-3x.jpg 3x"> | |
</picture> | |
<!-- | |
For browser windows with a width of 1024 CSS pixels and wider, | |
a full-shot photo is used; smaller browser windows get a close-up | |
photo. In addition, these photos are served as high-resolution images | |
to browsers on devices with high-DPI screens; other browsers get a | |
normal image. | |
--> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment