Tell us what’s happening:
I am unable to center the image please advise
Your code so far
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.109 Safari/537.36
.
Link to the challenge:
hi friend you made a mistake
change the
.img selector in your css code by #image
and add a
box-siznig:border-box to it;
Google is a web developers best friend.
Hundreds of answers for “how to center an img in a div” on stackoverflow.
to center an image you should write this code
imgSelector{
max-width:the width you want;
height:auto;
display:block;
margin:auto;
}
Thank you so much I will try that
I was able to fix it fully by the following css
img {
max-width: 100%;
height: auto;
}