Tell us what’s happening:
Hi I am having trouble with:
-
Failed:Your
img
element should have adisplay
ofblock
. -
Failed:Your
#image
should have amax-width
of100%
.
I have done everything to the best of my knowledge including:
#image {
max-width: 100%;
height: auto;
}
img {
display: block;
}
Your code so far
<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="Tribute Page" content="Project/>
<title>Tribute Page/title>
<link rel="stylesheet" href="styles.css" />
</head>
<main id="main">
<header id="title">
<h1>Dr. Norman Borlaug</h1>
</header>
<body>
<div id="img-div">
<div id="img-caption">The man who saved a billion lives</div>
<img id="image" src="https://cdn.freecodecamp.org/testable-projects-fcc/images/tribute-page-main-image.jpg" width="100%" max-width="100%" display="block">
</div>
<div id="tribute-info">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>
<a id="tribute-link" href="https://cdn.freecodecamp.org/testable-projects-fcc/images/tribute-page-main-image.jpg" target="_blank">
</body>
</main>
</html>
/* file: styles.css */
#image {
display: block;
max-width: 100%;
height: auto;
}
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36
Challenge: Tribute Page - Build a Tribute Page
Link to the challenge: