Last active
March 17, 2023 18:56
-
-
Save Polkovn1k/cabf1f310ea896f5fd339d49bafded86 to your computer and use it in GitHub Desktop.
Adaptive img (HTML)
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 type="image/webp" media="(min-width: 1250px)" srcset="img/desktop@x1.webp 1x, img/desktop@x2.webp 2x"> | |
<source type="image/webp" media="(min-width: 768px)" srcset="img/tablet@x1.webp 1x, img/tablet@x2.webp 2x"> | |
<source type="image/webp" srcset="img/mobile@x1.webp 1x, img/mobile@x2.webp 2x"> | |
<source media="(min-width: 1250px)" srcset="img/desktop@x1.jpg 1x, img/desktop@x2.jpg 2x"> | |
<source media="(min-width: 768px)" srcset="img/tablet@x1.jpg 1x, img/tablet@x2.jpg 2x"> | |
<img src="img/mobile@x1.jpg" srcset="img/mobile@x1.jpg 1x, img/mobile@x2.jpg 2x" alt="" title=""> | |
</picture> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment