Tribute Page - Build a Tribute Page

Tell us what’s happening:
Describe your issue in detail here.
Hi, I have issue with 3 tests:

  • Your img element should have a display of block.
  • Failed: Your #image should have a max-width of 100%.
    Failed: Your #image should be centered within its parent.

But my code should be good. Can’t figured out what happen.

Your code so far

<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Tribute page</title>
    <link rel="stylesheet" src="styles.css" />
    <meta charset="utf-8"/>
  </head>
  <body>
    <header>
      <h1 id="title">Dr. Norman Borlaug</h1>
      <p>The man who saved a billion lives</p>
    </header>
    <main id="main">
      <figure id="img-div">
        <img id="image" src="https://cdn.freecodecamp.org/testable-projects-fcc/images/tribute-page-main-image.jpg" alt="Dr. Norman Borlaug" />
        <figcaption id="img-caption">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.</figcaption>
      </figure>
      <section id="tribute-info">
        <h3>If you have time, you should read more about this incredible human being on his <a id="tribute-link" href="https://en.wikipedia.org/wiki/Norman_Borlaug" target="_blank">Wikipedia entry</a>.</h3>
      </section>
    </main>
  </body>
</html>
/* file: styles.css */
#image {
  max-width: 100%;
  height: auto;
}
img {
  display: block;
  margin: 0 auto;
}

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/110.0

Challenge: Tribute Page - Build a Tribute Page

Link to the challenge:

I thing that you should put the display and the margin inside the #image { } and you remove the img{}

Solved.
Just add all this css inside the html tag - and it`s fixed

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