Created
May 27, 2024 18:02
-
-
Save EugenNekrasov/6b462faba88a7b0a1a04f7fd3c548102 to your computer and use it in GitHub Desktop.
Adaptive picture with few formats
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: 1200px)" srcset="desktop@1x.webp 1x, desktop@2x.webp 2x" type="image/webp"> | |
<source media="(min-width: 1200px)" srcset="desktop@1x.png 1x, desktop@2x.png 2x" type="image/png"> | |
<source srcset="mobile@1x.webp 1x, mobile@2x.webp 2x" type="image/webp"> | |
<source srcset="mobile@1x.png 1x, mobile@2x.png 2x" type="image/png"> | |
<img src="mobile@1x.png" alt="Fallback image"> | |
</picture> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment