Tribute page - The <img> element should be centered within its parent element

Hi Everyone, can someone please assist me with the last story of my tribute page. Im not sure what im doing wrong here.

need to complete this

The element should be centered within its parent element.

my code

1 Like

Error message says about using display property and setting it to block.

Also you need to set margin to auto so that it centers the image horizontally.

Also height: auto isn’t required.

Thank you for your help. But im still getting the same error. Im totally stuck on this one.

any advice?

Got it! thanks to @Qasim

Your previous code with my new changes were working fine. Now you’ve different issue. id is incorrect in css & max-width is missing & margin should be auto.

#image {
   max-width: 100%;
   margin: auto;
   display: block;

That’s great :cool: :+1:

Thanks, it worked for me

1 Like