Tribute Page - Build a Tribute Page

I keep getting this feedback- You should have a figcaption or div element with an id of img-caption . But I have the div element with id of img-caption

Your code so far

<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="styles.css">
    <title="tribute page" id="title">Tribute Page</title>
  </head>

  <body>
    <main id="main">
      <h1 id="img-caption">Description Of Image</h1>
    <div id="img-div">
       
      <img id="image"src="https://cdn.freecodecamp.org/testable-projects-fcc/images/tribute-page-main-image.jpg" alt="Tribute">

      <div id= "img-caption">Men standing in Wheat
      </div>    
    </div>
    <section id="tribute-info">abc</section>
    <a id="tribute-link" href="https://en.wikipedia.org/wiki/Norman_Borlaug" target="_blank">Wiki Info</a>
    </main>
  </body>

</html>
/* file: styles.css */
img {
  max-width:100%;
  height: auto;
  display: block;
  margin:0 auto;
}

#img-caption {
  margin: 15px 0 5px 0;
}

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36

Challenge: Tribute Page - Build a Tribute Page

Link to the challenge:

You also are using the id of “img-caption” on this h1. Id’s must be unique on the page, so you can’t use “img-caption” for both the h1 and the div. These duplicate ids are causing you to fail the tests.

Thank you so much.That was really helpful. My test passed after removing the id from h1.

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