Skip to content

next/image, how to set image width to 100%? #18474

Answered by zeekrey
ghost asked this question in Help
Discussion options

You must be logged in to vote

In Version 10.0.1 they added the layout prop to the image component. Setting it to responsive sets the css max-/min-width to 100%. Maybe this works for your usecase.

Replies: 10 comments 33 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
7 replies
@MathiasKandelborg
Comment options

@urgn
Comment options

@aranoe
Comment options

@nannu-coder
Comment options

@goodnewsj62
Comment options

Answer selected by Timer
Comment options

You must be logged in to vote
20 replies
@swport
Comment options

@NishargShah
Comment options

@Ingcamilo1020
Comment options

@brianonchain
Comment options

@qingyao-tan
Comment options

Comment options

You must be logged in to vote
1 reply
@donguyenba
Comment options

Comment options

You must be logged in to vote
1 reply
@NafiurSiddiqui
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@KakkoiDev
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@NishargShah
Comment options

@echives
Comment options

@seancheung
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet