Tell us what’s happening:
the “image must be centered within parent element” requirement isn’t being met
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">
<link rel="stylesheet" href="./styles.css">
<title>sleeping cat</title>
</head>
<body>
<main id="main">
<header id="title">
<h1>Sleeping Cat</h1>
</header>
<figure id="img-div">
<img src="https://cdn.freecodecamp.org/curriculum/css-photo-gallery/4.jpg" id="image" alt="sleeping cat" class="image">
<figcaption id="img-caption">
Cat dozing under bedcovers.
</figcaption>
</figure>
<section id="tribute-info">
<h3 class="list">Cat Sleeping Positions</h2>
<ul class="list">
<li>Curled into a ball</li>
<li>On their back</li>
<li>Side sleeping</li>
<li>Loaf pose</li>
</ul>
<p>Read more <a id="tribute-link" target="_blank" href="https://www.petmd.com/cat/general-health/cat-sleeping-positions-and-what-they-mean">here</a></p>
</section>
</main>
</body>
</html>
/* file: styles.css */
h1{
text-align: center;
padding: 10px;
font-size: 2.5rem;
}
header{
background-color: #D3D3D3;
}
img{
max-width: 100%;
display: block;
height: auto;
margin: auto;
padding: 20px;
align-items: center;
}
figcaption{
text-align: center;
font-size: 1.2rem;
display: block;
padding: 2px;
}
figure{
background-color: #D3D3D3;
}
section{
display: block;
background-color: #d3d3d3;
padding: 5px;
align-item: center;
}
body{
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
font-size: 1.3rem;
line-height: 1.3;
text-align: center;
color: #333;
margin: 0;
}
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36
Challenge Information:
Tribute Page - Build a Tribute Page