Next.js Discord

Discord Forum

center an image and make it responsive

Unanswered
Briard posted this in #help-forum
Open in Discord
BriardOP
hello , i want to get to this using image tag , but i dont understand should i set fixed width and height?
if so how will it be responsive?
should i use fill mode or sizes property?

4 Replies

BriardOP
hmm
If you use "fill" you will need to wrap the <Image/> with a <div className="relative"/> and it's important this div has position relative .
@LuisLl If you use "fill" you will need to wrap the `<Image/>` with a `<div className="relative"/>` and it's important this div has **position relative **.
BriardOP
but the div should have specific width and height tho?
is that responsive
It can have dynamic sizes and the image should just “fill” it.

Also, afaik, the Image component is responsive by default