Tell us what’s happening:
Hello, hope you all are doing well. I don’t understand what is happening. It keeps telling me that:
-
Your
imgelement should have adisplayofblock. -
Your
#imageshould have amax-widthof100%. -
Your
#imageshould be centered within its parent.
Your code so far
<!-- file: index.html -->
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Build a Survey Form</title>
</head>
<body>
<main id="main">
<div id="title">
<h1>Dr. Norman Borlaug</h1>
</div>
<div id="img-div">
<img id="image" src="https://upload.wikimedia.org/wikipedia/commons/e/e2/Norman_Borlaug%2C_2004_%28cropped%29.jpg" alt="Dr. Norman Borlaug">
<figcaption id="img-caption">Dr. Norman Borlaug Picture</p>
</div>
<div id="tribute-info">
<p>Dr. Norman Borlaug was a scientist and humanitarian who played a key role in the Green Revolution, saving millions from hunger.</p>
</div>
<a id="tribute-link" href="https://en.wikipedia.org/wiki/Norman_Borlaug" target="_blank">Learn more about Dr. Norman Borlaug</a>
</main>
</body>
</html>
/* file: styles.css */
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
color: #333;
margin: 0;
padding: 0;
}
#main {
max-width: 800px;
margin: 20px auto;
padding: 20px;
background-color: #fff;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
#title {
text-align: center;
margin-bottom: 20px;
}
#img-div {
text-align: center;
}
#image {
max-width: 100%;
height: auto;
display: block;
margin: 0 auto;
}
#img-caption {
margin-top: 10px;
font-style: italic;
}
#tribute-info {
margin-top: 20px;
}
#tribute-link {
display: block;
text-align: center;
margin-top: 20px;
color: #007BFF;
text-decoration: none;
}
#tribute-link:hover {
text-decoration: underline;
}
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
Challenge Information:
Tribute Page - Build a Tribute Page