Large image rendering issue in Next js #146398
-
Select Topic AreaBug BodyI am trying to render an image inside a div, but the issue with my code is the image renders not properly, still some part of the image is hidden on y-axis, I uploaded the same image on instagram and it's working just fine. basically I have a shadcn modal, where I want to render the image, `
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
You can fix this by locking the image's aspect ratio. Check out Shadcn's AspectRatio component or Tailwind's aspect ratio |
Beta Was this translation helpful? Give feedback.
-
Thanks for posting in the GitHub Community, @aziz-codes! We're happy you're here. You are more likely to get a useful response if you are posting your question in the applicable category, the Discussions category is solely related to conversations around the GitHub product Discussions. This question should be in the Programming Help category. I've gone ahead and moved it for you. Good luck! |
Beta Was this translation helpful? Give feedback.
-
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
Beta Was this translation helpful? Give feedback.
You can fix this by locking the image's aspect ratio. Check out Shadcn's AspectRatio component or Tailwind's aspect ratio
https://ui.shadcn.com/docs/components/aspect-ratio
https://v1.tailwindcss.com/course/locking-images-to-a-fixed-aspect-ratio