Skip to content

How to set Image width and height with tailwindcss in Next.js #8692

Closed Answered by crswll
zhondori asked this question in Help
Discussion options

You must be logged in to vote

It's asking you to set width and height properties (like react props), not just set a width and height on the element. You should set width={500} height={200} or somthing along those lines with the image's natual dimensions (won't worry, the values you set in CSS will overrides those). I'd definitely read the docs: https://nextjs.org/docs/api-reference/next/image#width

Replies: 5 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by zhondori
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
6 participants