Created
July 1, 2022 03:36
-
-
Save chasoft/0a0aaa2865531fe16f68a9a63c089fac to your computer and use it in GitHub Desktop.
Sample for picture tag in html5
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={`${mockupDesktop} 1x, ${mockupDesktop2x} 2x, ${mockupDesktop3x} 3x, ${mockupDesktop4x} 4x`} | |
media="(min-width: 768px)" | |
/> | |
<source | |
srcSet={`${mockupMobile} 1x, ${mockupMobile2x} 2x, ${mockupMobile3x} 3x, ${mockupMobile4x} 4x`} | |
media="(max-width: 767px)" | |
/> | |
<img | |
src={mockupDesktop4x} | |
srcSet={`${mockupDesktop} 1x, ${mockupDesktop2x} 2x, ${mockupDesktop3x} 3x, ${mockupDesktop4x} 4x`} | |
height={589.82} | |
width={298.38} | |
alt="" | |
className="max-w-48 md:max-w-72" | |
decoding="async" | |
/> | |
</picture> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Source: Remix Discord