Skip to content

Instantly share code, notes, and snippets.

@chasoft
Created July 1, 2022 03:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chasoft/0a0aaa2865531fe16f68a9a63c089fac to your computer and use it in GitHub Desktop.
Save chasoft/0a0aaa2865531fe16f68a9a63c089fac to your computer and use it in GitHub Desktop.
Sample for picture tag in html5
<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>
@chasoft
Copy link
Author

chasoft commented Jul 1, 2022

Source: Remix Discord

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment