Tribute Page - Build a Tribute Page

Tell us what’s happening:
I don’t understand what I’m doing wrong now…
it just shows the error to set max-width to 100%
and center the image within its parent element.

Your code so far

<!-- file: index.html -->
<!DOCTYPE html>
<html>
  <main id="main">
    <link href="styles.css" rel="stylesheet">
    <head>
      <meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">      
      <title id="title">
        </title>
        <div id="1">
          <h1>Dr. Norman Borlaug</h1>
          <p id="p">The man who saved a billion lives</p>
          </div>
    </head>
    <div id="img-div">
      <div id ="img">
      <img src="https://cdn.freecodecamp.org/testable-projects-fcc/images/tribute-page-main-image.jpg" id="image">
      <div 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.</div>
        </div>
        <div id="tribute-info">
          Here's a time line of Dr. Borlaug's
          </div>
          <footer>
            If you have time, you should read more about this incredible human being on his  <a href="https://en.wikipedia.org/wiki/Norman_Borlaug" id ="tribute-link" value ="tribute-link" target="_blank">
            Wikipedia entry
            </a>.</div>
      </footer>
  </main>
</html>      
/* file: styles.css */
image {height:auto;
max-width:100%;
margin:0 auto;
}

img{display:block;
}

Your browser information:

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

Challenge: Tribute Page - Build a Tribute Page

Link to the challenge:

This targets an element called image

I don’t think there is an element called image in html?

actually i have given my img element an id of “image”
and if it is about the dot in css then i tried it too still no progress

  • edit nvm u were right

An id selector in CSS is prefixed with #. Classes are prefixed with dots.

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