Next/Image component does not work with height="auto" #32596
Unanswered
fariasmateuss
asked this question in
Help
Replies: 2 comments 5 replies
-
Hello. You need to use the
See: https://nextjs.org/docs/api-reference/next/image#layout |
Beta Was this translation helpful? Give feedback.
1 reply
-
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.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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