Last active
May 24, 2018 17:15
-
-
Save kldkv/455a0adf81d91ad04f84c91e4af28ed6 to your computer and use it in GitHub Desktop.
picture srcset
This file contains hidden or 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: 1280px)" | |
sizes="50vw" | |
srcset="opera-fullshot-200.webp 200w, | |
opera-fullshot-400.webp 400w, | |
opera-fullshot-800.webp 800w, | |
opera-fullshot-1200.webp 1200w, | |
opera-fullshot-1600.webp 1600w, | |
opera-fullshot-2000.webp 2000w" | |
type="image/webp"> | |
<source | |
sizes="(min-width: 640px) 60vw, 100vw" | |
srcset="opera-closeup-200.webp 200w, | |
opera-closeup-400.webp 400w, | |
opera-closeup-800.webp 800w, | |
opera-closeup-1200.webp 1200w, | |
opera-closeup-1600.webp 1600w, | |
opera-closeup-2000.webp 2000w" | |
type="image/webp"> | |
<source | |
media="(min-width: 1280px)" | |
sizes="50vw" | |
srcset="opera-fullshot-200.jpg 200w, | |
opera-fullshot-400.jpg 400w, | |
opera-fullshot-800.jpg 800w, | |
opera-fullshot-1200.jpg 1200w, | |
opera-fullshot-1600.jpg 1800w, | |
opera-fullshot-2000.jpg 2000w"> | |
<img | |
src="opera-closeup-400.jpg" alt="The Oslo Opera House" | |
sizes="(min-width: 640px) 60vw, 100vw" | |
srcset="opera-closeup-200.jpg 200w, | |
400w, | |
opera-closeup-800.jpg 800w, | |
opera-closeup-1200.jpg 1200w, | |
opera-closeup-1600.jpg 1600w, | |
opera-closeup-2000.jpg 2000w"> | |
</picture> | |
// | |
<picture> | |
<source media="(min-resolution: 288dpi)" srcset="{{item[0]}}"> | |
<source media="(min-resolution: 144dpi)" srcset="{{item[1]}}"> | |
<img class="latest-work__image" src="{{item[2]}}" alt="Photo" width="125"> | |
</picture> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment