Next/Image component does not work with height="auto" #32596
Unanswered
fariasmateuss
asked this question in
Help
Replies: 2 comments 9 replies
-
Hello. You need to use the
See: https://nextjs.org/docs/api-reference/next/image#layout |
Beta Was this translation helpful? Give feedback.
3 replies
-
This solution from #18474 (comment) works for me: <Image
src="url"
width={0}
height={0}
sizes="100vw"
style={{ width: '100%', height: 'auto' }}
/> |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Next/Image component does not work with
height="auto"
. Why?The image doesn't have a fixed height, but if I don't pass a value, it doesn't show up on screen. How can I resolve this?
Beta Was this translation helpful? Give feedback.
All reactions