Tribute Page Image Help?

The bare bones of my tribute page are mostly fine, but the image CSS is causing me trouble. The one thing I can’t pass is:

  • Your #image should be centered within its parent.
    I’ve compared it to the HTML in the example as well as another student’s work and stackoverflow examples and I don’t know what I’m missing! Help please! Here’s the relevant code
  <div id="img-div">
          <img id="image" src=",h_335,al_c,q_80,usm_0.66_1.00_0.01,enc_auto/DNGreenwood%20final_edited.jpg" alt="a picture of Dr. Greenwood">
          <figcaption id="img-caption">Dr. Greenwood</figcaption>


#image {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  justify-content: center;

Here’s screenshots:

Let me know if I need to supply any more info, any help is appreciated!

(Note: In the screenshot it says I’m missing 3 things needed to pass, but the problem was in the boilerplate and I’ve since fixed those)

Please post all your code and a link to the challenge when asking for help.

edit: you can not use justify-content with display block it has to be flex or grid.

Did you try adding an auto margin?

margin: 0 auto ;
1 Like

It worked! Thank you so much, I’ll keep that handy rule as well as forum etiquette in mind

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.