Tribute Page - Build a Tribute Page

Tell us what’s happening:
I am passing all aspects expect the last one for #image

Your code so far

<!-- file: index.html -->
<!DOCTYPE html>
<html lang='en'>
  <head>
    <meta charset='utf-8'/>
    <link rel='stylesheet' href='./styles.css'></link>
    <title>freeCodeCamp Tribute Page</title>
  </head>
  <body>
    <main id='main'>
      <h1 id='title'>Dr. Norman Borlaug</h1>
      <figure id='img-div'>
        <img id='image' />
      <figcaption id='img-caption'>The man who saved a billion lives</figcaption>
      </figure>
      <p id="tribute-info"><a id="tribute-link" href='' target='_blank'>Dr. Norman Borlaug, third from the left, trains biologists in Mexico on how to increase wheat yields - part of his life-long war on hunger</a></p>
    </main>
  </body>
</html>
/* file: styles.css */
main{ 
  text-align: center
}
#image{
  max-width: 100%;
  height: auto; 
  align-content: center;
}
img{ 
display: block;
align-items: center; 
}

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36

Challenge: Tribute Page - Build a Tribute Page

Link to the challenge:

in general, centering is done by setting the display to block and align-items to center (which you have done) but also by setting the margin-left and margin-right to auto.

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