fill prop in Next/image didn't take parent height
Answered
MyMy posted this in #help-forum
MyMyOP
I want to image stretch to parent element so i'm using fill prop in Next/image element but it's not take parent height
How can i make it take parent height?
Here's my code:
How can i make it take parent height?
Here's my code:
<div className="relative h-full w-full">
<Swiper slidesPerView={1}>
{images.map((image) => (
<SwiperSlide key={image}>
<Image
src={`/manga/1/chap-1/${image}`}
fill={true}
alt={image}
></Image>
</SwiperSlide>
))}
</Swiper>
</div>Answered by MyMy
for those who use swiper framework. Make sure swiper container take parent width and height