Skip to content

Instantly share code, notes, and snippets.

@x3r0s
Created May 3, 2022 01:57
Show Gist options
  • Save x3r0s/0f8c7128dbd76127f4c317d926ed31ce to your computer and use it in GitHub Desktop.
Save x3r0s/0f8c7128dbd76127f4c317d926ed31ce to your computer and use it in GitHub Desktop.
Next.js <Image> & tailwind 반응형 이미지 제공하는 방법
import Image from 'next/image'
<div>
<div className="md:hidden">
<Image src="Banner-767x500.webp" height={500} width={767} />
</div>
<div className="hidden md:inline-flex lg:hidden">
<Image src="Banner-1023x500.webp" height={500} width={1023} />
</div>
<div className="hidden lg:inline-flex xl:hidden">
<Image src="Banner-1400x500.webp" height={500} width={1400} />
</div>
<div className="hidden xl:inline-flex">
<Image height={500} width={2000} src="Banner-2000x500.webp" />
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment