Yes I know total noob I just started learning about a week ago. I’m on a project now to design a tribute page, and for the first time I’m simply trying to put a picture and have it centered using flexbox. But holy guacamole it will not center nomatter what i do! I tried giving the image a name/class and using that directly in css i tried putting it into div containers, i’ve googled everything I could and this picture simply refuses to center. It’ll do everything else, resize and so on, but it DOES NOT want to center. Any help is appreciated!
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<main id="main">
<div class="top-of-page">
<h1 id="title">Why Foxes Are So Cute</h1>
<p><i>Really, all of them</i></p>
<figure>
</div>
<img id="images" src="https://img.freepik.com/premium-photo/beautiful-fox-sleeping-kennel-roof_149066-215.jpg"
</figure>
</main>
</body>
<html>
css code:
.top-of-page {
text-align: center;
font-family: Arial;
background-color: #ffcd91;
margin-top: 1%;
padding: 1% 0 1%;
margin-bottom: 5px;
}
img {
display: flex;
width: 80%;
justify-content: center;
align-items: center;
}