Tell us what’s happening:
Describe your issue in detail here.
I try everything, the error are:
Your img
element should have a display
of block
.
Your #image
should have a max-width
of 100%
.
Your code so far
<!-- file: index.html -->
<!-- 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 */
/* file: styles.css */
#image, img {
display: block;
max-width: 100%;
height: auto;
}
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 Edg/122.0.0.0
Challenge Information:
Tribute Page - Build a Tribute Page