Build a tribute page - image ID and image max-weigth 100%

Hi all, newbie here, I was testing my code, and the following dont pass the test, help please?

You should have an img element with an id of image .

Your #image should have a max-width of 100% .

My HTML CODE:
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8"/>
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
     <link rel="stylesheet" href="styles.css">
    <title id='title'>Dr. Norman Borlaug</title>
  </head>


  <body>
    <main id="main">
    <div class="header">
      <div class="header-title">Dr. Norman Borlaug</div>
      <div class="header-p">The man who saved a bilion lives</p>
    </div>

    <div id= "image">
      <div id= "img-div" class="img-div">
      <img id="image" src="src" alt="Dr. Norman Borlaug seen standing in Mexican wheat field with a group of biologists" >
      <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>
    </div>
    </div>




    <section id="tribute-info" Class="tribute-info">
      <div class="tribute-info">
      <h3>Here's a time line of Dr. Borlaug's life:<h3>
      <ul>
        <li>1914 - Born in Cresco, Iowa</li>
        <li>1933 - Leaves his family's farm to attend the University of Minnesota, thanks to a Depression era program known as the "National Youth Administration"</li>
        <li>1935 - Has to stop school and save up more money. Works in the Civilian Conservation Corps, helping starving Americans. "I saw how food changed them", he said. "All of this left scars on me."</li>

        <li>1937 - Finishes university and takes a job in the US Forestry Service</li>
        <li>1938 - Marries wife of 69 years Margret Gibson. Gets laid off due to budget cuts. Inspired by Elvin Charles Stakman, he returns to school study under Stakman, who teaches him about breeding pest-resistent plants.</li>
        <li>1941 - Tries to enroll in the military after the Pearl Harbor attack, but is rejected. Instead, the military asked his lab to work on waterproof glue, DDT to control malaria, disinfectants, and other applied science.</li>
<li>1942 - Receives a Ph.D. in Genetics and Plant Pathology
1944 - Rejects a 100% salary increase from Dupont, leaves behind his pregnant wife, and flies to Mexico to head a new plant pathology program. Over the next 16 years, his team breeds 6,000 different strains of disease resistent wheat - including different varieties for each major climate on Earth.</li>
<li>1945 - Discovers a way to grown wheat twice each season, doubling wheat yields</li>
<li>1953 - crosses a short, sturdy dwarf breed of wheat with a high-yeidling American breed, creating a strain that responds well to fertilizer. It goes on to provide 95% of Mexico's wheat.</li>
<li>1962 - Visits Delhi and brings his high-yielding strains of wheat to the Indian subcontinent in time to help mitigate mass starvation due to a rapidly expanding population</li>
<li>1970 - receives the Nobel Peace Prize</li>
<li>1983 - helps seven African countries dramatically increase their maize and sorghum yields</li>
<li>1984 - becomes a distinguished professor at Texas A&M University</li>
<li>2005 - states "we will have to double the world food supply by 2050." Argues that genetically modified crops are the only way we can meet the demand, as we run out of arable land. Says that GM crops are not inherently dangerous because "we've been genetically modifying plants and animals for a long time. Long before we called it science, people were selecting the best breeds."</li>
<li>2009 - dies at the age of 95.</li>

<a id="tribute-link" href="href" target="_blank">Wikipedia entry</a>


      </ul>
      </div>



</main>
</body>
</html>

MY CSS CODE:

*{
  background-color: #dfdfe2;
}

body{
  font-size:100%
}

.header{
  text-align:center;
  font-family:tahoma;
  width:90%;
  height:100px;
  display:block;
  padding:10px;
  margin:auto;
}

.header-title{
  font-size: 5em;
  display:block;
  padding:1px;
}

.header-p{
  font-size: 1.5em;
  display:block;
  padding:1px;
}

img{
  max-width:100%;
  max-height:auto;
}

.img-div{
  background-color:#ffffff;
  max-width:100%;
  text-align:center;
  display:block;
  padding:25px;
  margin:auto;
}

.img-div figcaption{
  background-color:#ffffff;
  text-align:center;
  margin: 15px 0px;
}

h3{
  font-family:tahoma;
  font-weight:bold;
  
}

.tribute-info{
  margin: auto;
  max-width:75%
}

li{
  text-align:left;
  font-family:tahoma;
  display:list-itme;
  line-height:40px;
  margin-right:36px;
  margin-top:30px;
  font-size:1em;
}

I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

You have two image id’s in your code, which confuses the tests.

The id attribute is only used once in a html code.

Works like a charm! Thank you ! and Happy New Year to you!! :wink:

1 Like

Thanks for the tip, will do so in the future!!

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