What's the best way of making a Next.js image component fit the parent size?
The width and height is necessary, though I can't set it to
"100%"
or something similar. How do I achieve this the best way possible without hard coding it?6 Replies
Remove heigjt and width
Solution
Use fill property
And set the parent pisition to relative
Optionally using object-cover could be useful
I'll check into that, thanks
any luck?
Yup, I had a few other issues in the meantime but I got it to work, thanks