Next.js · Junior · Question 38 of 75
What do you pass to <Image> for an image that stretches over the whole parent block?
- ✓Correct answer: The
fillprop, withposition: relativeon the parent - 2
width="100%"andheight="100%"as strings - 3Nothing:
<Image>fills its parent by default
Explanation
When dimensions aren't known in advance, use fill: the image is absolutely positioned and fills the parent, which must be relative, absolute or fixed. sizes hints how wide the image will be so the browser doesn't download a file that's too large. Fitting is controlled with object-fit.